Pick of the Week - Nov 10 [Show all picks]
Path Finder 5 - A feature-laden Finder replacement
Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
13,000 hints and counting!

Mount and unmount external drives easily via AppleScript Storage Devices
I like to eject my external drives because they slow down my mac when they spin up, but I want to have an easy way to access them if I need to. I wrote a little AppleScript that will toggle the mount status of the drive (if it's mounted, it will eject, if it's unmounted, it will mount).

To run the script, use the script menu at the right of the menu bar, or bind it to a hot key using a Quicksilver-type app. Be sure to change 'YourDiskNameHere' to the name of the volume you're working with.

The script can be easily adapted to only eject, or only mount the drive. You can also tweak it to display a Mount/Unmount dialog if you wish.
set diskName to "YourDiskNameHere"
tell application "Finder"
 if disk diskName exists then
  eject disk diskName
 else
  tell current application
   set deviceLine to (do shell script "diskutil list | grep \"" & diskName & "\" | awk '{ print substr($0,69,9) }'")
   if deviceLine = "" then
    display dialog "The disk \"" & diskName & "\" cannot be found." buttons {"OK"} default button 1 with title "Error" with icon caution
   end if
   set foundDisks to paragraphs of deviceLine
   repeat with i from 1 to number of items in foundDisks
    set this_item to item i of foundDisks
    if this_item contains "disk" then
     do shell script "diskutil mountDisk /dev/" & this_item
    end if
   end repeat
  end tell
 end if
end tell

[crarko adds: Seems to work fine.]
  Post a comment  •  Comments (0)  
  • Currently 5.00 / 5
  You rated: 5 / 5 (1 vote cast)
 
[57 views] Email Article To a Friend View Printable Version
10.7:Quartz Debug 4.2 hidden prefs Apps
Apple has changed the 'magic open sesame' to all the cool hidden features of Quartz Debug in version 4.2.

Why make such a useful app and then hide almost every feature? I just can't understand the logic in this.

Anyway as an update of my old hint here are the new steps to take to gain access to the goodies.
  • Launch Terminal.
  • At the prompt, type the following command line followed by [Enter]:

    defaults write com.apple.QuartzDebug QuartzDebugPrivateInterface -boolean YES

  • Launch Quartz Debug and you should notice new options in the 'Tools' and 'Windows' menus.
  • Should you like to undo the changes and go back to the stock Quartz Debug just type the following in Terminal (followed by [Enter]):

    defaults delete com.apple.QuartzDebug QuartzDebugPrivateInterface

  • Close any window not normally accessible from the menu and voila your QD is as it was.
If by any chance someone knows how to use the profiling stuff don't hesitate to post a comment or a follow-up hint.

[crarko adds: I tested this, and it works as described.]
  Post a comment  •  Comments (0)  
  • Currently 1.00 / 5
  You rated: 1 / 5 (1 vote cast)
 
[55 views] Email Article To a Friend View Printable Version
10.6: Make a universal 10.6.7 Snow Leopard installer System 10.6
Why do we need this? Because Apple quit releasing full retail versions of Snow Leopard with 10.6.3. If you have an Apple computer made after the Core 2 Duos, the 10.6.3 retail disk may not boot, and the 10.6.0 version won't boot at all. Early 2011 MacBook Pros fall in this category. Version 10.6.7 was the last version released on DVD, but the DVDs were locked to specific machines. We are are going to unlock a 10.6.7 DVD and make it a universal Installer.

How to do it:
  • Use Disk Utility to make a read/write DMG of a 10.6.7 install disk for a MacBook Pro or iMac. Version 10.6.6 might work, but I haven't tried it.
  • Set the Finder to reveal hidden files:
  • open Terminal and type or copy and paste the following line:

    defaults write com.apple.finder AppleShowAllFiles TRUE

  • Press the Enter key.
  • Then type:

    killall Finder

  • Press the Enter key again.
  • To reverse this, rerun with FALSE instead of TRUE and killall Finder again
  • Insert a 10.6.0 or 10.6.3 OSX retail installation disk in your DVD drive and use the Finder to open the disk to system/Installation/Packages/
  • One of these package files is OSInstall.mpkg which is the set of instructions for the Installer. This file in the 10.6.7 Installer is where the checking is done to see if it's installing to the 'correct' computer.
  • Open another Finder window, and navigate to the same place in the 10.6.7 Installer. Replace the existing OSInstall.mpkg file with the one from the retail disk plus copy over all the printer related Installer packages. We do this because the retail installation script won't install the 10.6.7 printer packages. Check the 'copy all' box when the Finder warns you that the files already exist.
  • Open Disk Utility and plug in an 8 gig thumb drive. Find the drive on the left side of the Disk Utility window and click on it. Now click Partition, chose 1 Partition, give it a name and click the Options button. Choose the GUID partition choice and close the window. Click the Partition button. When the Disk Utility is done, use SuperDuper or Carbon Copy Cloner to clone the modified 10.6.7 Installer to the 8 gig keychain drive. I had problems getting the Backup utility in Disk Utility to do this. You can boot any ready for Snow Leopard Mac with this Installer.

[crarko adds: I know we've published hints like this in the past, but I just want to point out that the intent here is not to rip off Apple, but to handle what can be a very messy systems management issue in environments with many different models of Macs, using the tools that are available.]
  Post a comment  •  Comments (6)  
  • Currently 5.00 / 5
  You rated: 5 / 5 (5 votes cast)
 
[806 views] Email Article To a Friend View Printable Version
Fix a Finder sidebar resizing issue System
I noticed a few days ago that I was no longer able to resize my Finder's sidebar. When the mouse's cursor was over the border it didn't change to the resizing one and I couldn't modify the sidebar's width either.

I found the solution in a corrupt Finder preferences file. The 'ShowSidebar' option was turned off even when I was able to see the sidebar. Changing that value to 'YES' and killing the Finder solved my problem:

defaults write com.apple.Finder ShowSidebar -bool YES

killall Finder

Anyway, some part of the problem is still present since the preferences file and Finder's behavior are not related yet; if I change the setting back to 'NO' the sidebar is still shown but becomes sticky again. It appeared once I was changing a lot the visibility of sidebar, path bar and status bar to see different configurations.

I'm running 10.7.3.

[crarko adds: I can't reproduce this. It sounds like the Finder prefs are just messed up, and perhaps deleting the prefs file and starting fresh may do the trick. Has anybody else observed this issue?]
  Post a comment  •  Comments (1)  
  • Currently 4.00 / 5
  You rated: 4 / 5 (1 vote cast)
 
[598 views] Email Article To a Friend View Printable Version
Growl Notification from Mail.app with Sender Photos Apps
You can use an AppleScript to send a notification to Growl whenever new messages arrive in Mail.app. The script also includes the image of the sender from your Address Book as the icon of the Growl notification. Works in Snow Leopard and Lion.

I adapted a script written originally by Hunter Ford. I added the ability to include the image of the sender from the Address Book (if it exists). Britney F. helped me solve a couple of bugs -- Many thanks!

First you have to be using Mail.app and the latest version of Growl.

You can download the script from here and place in your /Library/Scripts folder or anywhere you wish.

To use this script, you have to add a rule in Mail.app to run the script for all new messages.

In Mail.app choose Preferences » Rules » Add New Rule. Then set the condition to 'Every Message' and the action to 'Run AppleScript' then choose the Mail2Growl.scpt from the folder you saved it in.

Whenever you get a new message, a Growl notification will appear with the image of the sender or a placeholder image if you do not have his/her image in your Address Book.

Here's the script (save it as Mail2Growl.scpt):
-- Mail2Growl
-- Growl Alerts in Mail
-- Wassim Jabi [http://wjabi.net]
-- Modified from the excellent script by Hunter Ford [http://www.cupcakewithsprinkles.com]
-- If it exists, this script sends the photo of the sender to Growl from the address book. Otherwise, it sends the sender place holder image from Mail.app.
-- Original script found at [http://hunterford.me/growl-notifications-for-apple-mail-on-mac-os-x/]
-- This script uses a tip to summarise many messages by "Ryan" in the comments section at [http://hunterford.me/growl-notifications-for-apple-mail-on-mac-os-x/]
-- This script also used tips from [http://www.macosxtips.co.uk] for finding photos in the Address Book
-- This script arises from the lack of any Growl Support in Mac OS X Snow Leopard (10.6) or Lion (10.7)
-- Code inspired by and adapted from James Higgs [http://blog.jameshiggs.com/2009/08/28/growlmail-on-snow-leopard-a-temporary-fix/] as well as those mentioned.

tell application "GrowlHelperApp"
  -- Make a list of all the notification types
  -- that this script will ever send:
  set the allNotificationsList to {"New Email"}
  
  -- Make a list of the notifications
  -- that will be enabled by default.
  -- Those not enabled by default can be enabled later
  -- in the 'Applications' tab of the growl prefpane.
  set the enabledNotificationsList to {"New Email"}
  
  -- Register our script with growl.
  -- You can optionally (as here) set a default icon
  -- for this script's notifications.
  register as application "Mail" all notifications allNotificationsList default notifications enabledNotificationsList icon of application "Mail"
end tell

-- Mail Rule Trigger
--
-- Source: Benjamin S. Waldie [http://www.mactech.com/articles/mactech/Vol.21/21.09/ScriptingMail/index.html]
using terms from application "Mail"
  on perform mail action with messages theSelectedMessages for rule theRule
    set N to count items of theSelectedMessages
    if (N > 5) then
      set multipleDescription to "" & N & " new messages"
      tell application "GrowlHelperApp"
        notify with name "New Email" title "You have " & N & " new messages." description " " application name "Mail"
      end tell
    else
      repeat with thisMessage in theSelectedMessages
        -- Process the current message
        
        -- Grab the subject and sender of the message
        set growlSender to my ExtractName(sender of thisMessage)
        try
          set growlPhoto to my getPhotoFromAddressBook(my ExtractEmailAddress(sender of thisMessage))
        on error
          set growlPhoto to read POSIX file "/Applications/Mail.app/Contents/Resources/SenderImagePlaceholder.png" as "TIFF"
        end try
        set growlSubject to subject of thisMessage
        set growlTitle to growlSender & return & growlSubject
        -- Use the first 100 characters of a message
        set growlDescription to (content of thisMessage)
        set growlLength to (length of growlDescription)
        
        if growlLength > 100 then
          set growlDescription to "" & (characters 1 through 100 of growlDescription) & " …"
        end if
        
        -- Send a Notification
        tell application "GrowlHelperApp"
          try
            notify with name "New Email" title growlTitle description growlDescription application name "Mail" image growlPhoto
          on error
            set growlPhoto to (read POSIX file "/Applications/Mail.app/Contents/Resources/SenderImagePlaceholder.png" as "TIFF")
            notify with name "New Email" title growlTitle description growlDescription application name "Mail" image growlPhoto
          end try
        end tell
      end repeat
    end if
  end perform mail action with messages
end using terms from

-- *ExtractName*
--
-- gathers the name portion from the "From: " line
--
-- Source: robJ [http://forums.macosxhints.com/archive/index.php/t-19954.html]
to ExtractName(sender_)
  if sender_ begins with "<" then
    return text 2 thru -2 of sender_
  else
    set oldTIDs to text item delimiters
    try
      set text item delimiters to "<"
      set name_ to first text item of sender_
      set text item delimiters to oldTIDs
    on error
      set text item delimiters to oldTIDs
    end try
    return name_ as string
  end if
end ExtractName

-- *ExtractEmailAddress*
--
-- gathers the email address portion from the "From: " line
--
-- Source: robJ [http://forums.macosxhints.com/archive/index.php/t-19954.html]
to ExtractEmailAddress(sender_)
  if sender_ begins with "<" then
    return text 2 thru -2 of sender_
  else
    set oldTIDs to text item delimiters
    try
      set text item delimiters to {"<", ">"}
      set email_ to second text item of sender_
      set text item delimiters to oldTIDs
    on error
      set text item delimiters to oldTIDs
    end try
    return email_ as string
  end if
end ExtractEmailAddress


to getPhotoFromAddressBook(sender_)
  set photo_ to read POSIX file "/Applications/Mail.app/Contents/Resources/SenderImagePlaceholder.png" as "TIFF"
  try
    tell application "Address Book"
      set photo_ to image of people whose value of emails contains sender_
    end tell
  on error
    set photo_ to read POSIX file "/Applications/Mail.app/Contents/Resources/SenderImagePlaceholder.png" as "TIFF"
  end try
  return photo_
end getPhotoFromAddressBook

[crarko adds: Tested briefly, seemed to work OK in 10.6.8. It looks like the most recent version of Growl (for Lion) is in the Mac App Store for US $1.99. The option to build it from source is still available as well.]
  Post a comment  •  Comments (5)  
  • Currently 5.00 / 5
  You rated: 5 / 5 (1 vote cast)
 
[882 views] Email Article To a Friend View Printable Version
Using S/MIME on iOS Devices iOS devices
I've recently written a blog post on using S/MIME with iOS devices. I've found that settings things up isn't entirely straight-forward so I've documented what I needed to do to make it work.

The article explains how to set up your iPhone or iPad to send and receive encrypted emails via S/MIME. The prerequisite is an S/MIME certificate from a certificate authority. Some CAs provide them free for personal use. The procedure is not very complicated even though the description may look lengthy due to the many screenshots. The biggest hurdle is to pick the correct file format when exporting your S/MIME key on your Mac.

The key is to export the certificate in Personal Information Exchange (.p12) format. These can then be imported to iOS.

Outline of the set-up for receiving encrypted emails:
  • Export your private key in a format that you can import on your iOS devices.
  • Next, save the certificate in p12 format.
  • Now drag this exported file to your Mail.app icon to send it to yourself.
  • Turn to your iOS device to import the certificate.
  • Enable S/MIME in advanced mail settings and choose your certificate.
Outline of the set-up for sending encrypted emails:
  • Import the recipient's public key.
  • Send the email.
Caveats:

What's a bit unfortunate is that there's no easy way to selectively send encrypted emails. The encryption setting is global for the account under 'Settings,' meaning that you have to go there and enable/disable encryption for all messages from that account. It would be nice if that were the default only, with an option to override it in the message composition view.

It would also be nice if public key importing were automatic, like it is on the Mac. But all in all, it's nice to be able to read encrypted emails on iOS devices now.

[crarko adds: To best follow the process, do take a look through the article at the link provided above. There are numerous screen captures on both the Mac and iOS sides which illustrate the procedure exactly, and are far more efficient than trying to translate them into verbiage.]
  Post a comment  •  Comments (2)  
  • Currently 3.50 / 5
  You rated: 2 / 5 (2 votes cast)
 
[742 views] Email Article To a Friend View Printable Version
10.7: Update to a workaround for a Boot Camp x64 installation issue System 10.7
Yesterday I finally got around to dual-booting my MacBook, with a nice fresh copy of Windows 7. Everything was great, except for a laggy download of the Windows Support Software. So, earlier today, I got around to installing the drivers. It turns out, my old MacBook didn't support BootCampx64. I then did a quick search on how to fix this issue.

I came up with a number of answers, but this is an answer aimed at people who were in my situation which is:
  • I could not right click on the BootCampx64.msi file, because of the missing drivers.
  • Or if I could right click, then changing the properties of BootCampx64.msi resulted in not having the required elevated access privileges.
My solution (done from within Windows, obviously):
  • Without the drivers installed, you can still right click on the BootCampx64.msi file by click it with 'Shift-F10' which apparently acts as an alternate right click.
  • If you have the first step down, try opening the properties of the file, and change the compatibility to earlier versions of Windows.
  • If that still doesn't work, then open the start menu. Then go to Programs » Accessories » CMD, and hover over CMD.
  • Press Shift-F10, or right click if you are able, on CMD (the Windows Command Prompt).
  • Select the option in the drop-down menu, 'Run as Administrator.'
  • Then open CMD and get a shell window.
  • Now, when you open CMD, you should be running it as C:Windowssystem32.
  • At the Command Prompt, type in cd /d C:
  • You should now have C: at the far left of the prompt.
  • Type in cd Users. Then type in dir.
  • Find your username, and then type in cd username, e.g. cd John Smith
  • Continue the dir, cd process until you come into the directory in which the BootCampx64.msi is. (You may have dragged the WindowsSupport folder onto the desktop, or someplace else).
  • After you have reached the directory, simply type in BootCampx64.msi.
  • The program should start.
  • All of the drivers should start installing. You probably won't be able to move your mouse if you have a trackpad, as I do, because the Apple Trackpad driver is one of the last to be installed.
If it seems like the process is taking a while, be patient.

Sources:

This earlier hint, this Apple forum thread, and this very helpful article.

[crarko adds: I haven't tested this one, as I don't use BootCamp. Reading this process reminds me why Windows desperately needs an equivalent to 'sudo' in its command prompt. If this procedure seems a bit confusing, take a look at the last article mentioned in the references, which has some screen grabs.]
  Post a comment  •  Comments (5)  
  • Currently 5.00 / 5
  You rated: 5 / 5 (2 votes cast)
 
[878 views] Email Article To a Friend View Printable Version
Airport Utility 6.0 Network
Airport Utility 6.0 was released a few days ago.

You may want to keep both 5.6 and 6.0 versions. I used Pacifist, and manually reinstalled the 5.6 version side by side. Lots of missing features in the new utility. No way to tweak wireless options for Mode, Frequency, Multicast Rate or Transmit Power, and such a tiny window for port mapping list. An elegant interface, but at a price.

For a thorough review and pointers to stand alone updates, read here.

[crarko adds: Consider this a public service announcement. It also appears that AirPort Utility 6.0 only functions with the 802.11(n) compatible base stations, so that old AirPort Express you may have (like I do) is not supported. I've actually saved many older versions of the utility, even for the original Graphite (flying saucer) bases.]
  Post a comment  •  Comments (12)  
  • Currently 1.75 / 5
  You rated: 1 / 5 (8 votes cast)
 
[1,117 views] Email Article To a Friend View Printable Version
10.7: See Exposé view of an app in the background System 10.7
This is a feature that allows you to see the Exposé of an app that is in the background. You'll need a Trackpad.

In OS X 10.7, the four-finger swipe down toggles app Exposé for the app in the foreground. Except if you place the cursor on the icon of a running app in the Dock, in which case the four-finger down swipe toggles the app exposé of THAT app, not the application that is in the foreground.

If you swipe down again without selecting a window from the Exposé view, you are taken back to the app you were in before toggling Exposé.

[crarko adds: I'd love to test this, but my Lion system is still trying to finish installing the 10.7.3 update, which has already taken considerably longer than anticipated.]
  Post a comment  •  Comments (3)  
  • Currently 3.67 / 5
  You rated: 5 / 5 (3 votes cast)
 
[873 views] Email Article To a Friend View Printable Version
Make the computer sing happy birthday System
Here's a way to use AppleScript and the 'say' command to have the computer sing happy birthday to you. Enjoy!
set currentUser to long user name of (get system info)
set firstName to first word of currentUser
set lastName to last word of currentUser

set noteValues to {56, 56, 58, 56, 61, 60, 50, 56, 56, 58, 56, 63, 61, 50, 56, 56, 68, 65, 61, 60, 58, 50, 66, 66, 65, 61, 63, 61} -- F
-- set noteValues to {65, 65, 67, 65, 70, 69, 60, 65, 65, 67, 65, 72, 70, 60, 65, 65, 77, 74, 70, 69, 67, 60, 75, 75, 74, 70, 72, 70} -- D
-- set noteValues to {55, 55, 57, 55, 60, 59, 50, 55, 55, 57, 55, 62, 60, 50, 55, 55, 67, 64, 60, 59, 57, 50, 65, 65, 64, 60, 62, 60} -- E

set syllables to {"hap", "p", "birth", "day", "to", "you", "[[slnc 500]]", "hap", "p", "birth", "day", "to", "you", "[[slnc 500]]", "hap", "p", "birth", "day", "dear", firstName, lastName, "[[slnc 500]]", "hap", "p", "birth", "day", "to", "you"}

repeat with i from 1 to the length of noteValues
	set thisValue to item i of noteValues
	set thisSyllable to item i of syllables
	if length of thisSyllable is less than 3 then
		set speakingRate to 220
	else
		set speakingRate to 100
	end if
	say thisSyllable pitch thisValue using "Cellos" speaking rate speakingRate modulation 0
end repeat

[crarko adds: Works as described. From the mind of Sal Soghoian. For extra credit tie it to an iCal reminder of a person's birthday, and see if you can put that person's name into the firstname and lastname variables and have it autoplay. A similar hint was also submitted by user 'Nyhthawk,' and I want to acknowledge that as well. Thanks!]
  Post a comment  •  Comments (10)  
  • Currently 4.33 / 5
  You rated: 4 / 5 (9 votes cast)
 
[1,474 views] Email Article To a Friend View Printable Version