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!

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 (0)  
  • Currently 5.00 / 5
  You rated: 5 / 5 (1 vote cast)
 
[227 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 (0)  
  • Currently 3.50 / 5
  You rated: 2 / 5 (2 votes cast)
 
[211 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)
 
[409 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.86 / 5
  You rated: 1 / 5 (7 votes cast)
 
[690 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)
 
[557 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,002 views] Email Article To a Friend View Printable Version
10.7: Updating Lion Server if using CalDAV and CardDAV OS X Server
If you plan to update your OS X Server to 10.7.2 be sure to restart your machine and stop all server services, especially iCal Server and Address book server before applying the update.

It happened to me yesterday that I applied the OS X 10.7.2 update to my Mac mini server without closing any apps. I just ran it. After the update it turned out, this was a big mistake. All calendar entries of the past three weeks and many contacts were lost.

I was not able to recover anything from time machine. Lion server keeps the CalDAV and CardDAV data in a PostgreSQL database which is apparently not backed up by TimeMachine. Also, the PostgreSQL uses transactions which need to be 'closed' before they end up being permanently written into the DB tables.

What I found from reviewing the postgres log file (/Library/Logs/PostgreSQL.log) is that the 10.7.2 server update will apply a whole bunch of database structure updates to PostgreSQL but without committing the latest transaction. Given that CalDAV entries a quite small, the transaction log may contain a lot of data which is then lost.

So, be aware to make sure you have your transaction log committed before you run the update. I assume a proper server shutdown (or reboot) and stopping of the server processes will do just this. Afterwards it should be safe to update.

Alternatively (and this is my weekend-fun-duty) have a client with all up to date calendars off-line and aside which servers as a backup.

[crarko adds: I haven't tested this one. In fact, I haven't had the chance to try Lion Server at all yet. I'd be interested to hear if others have experienced issues like the one described here.]
  Post a comment  •  Comments (3)  
  • Currently 5.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)
 
[698 views] Email Article To a Friend View Printable Version
10.7: Auto-copy Photo Stream images to a folder System 10.7
To get the Photo Stream working on my MacBook I found out that I had to BUY an upgrade for an application that I don't want: iPhoto.

Looking for a solution I found that iPhoto stores its pictures in a specific location and the Photo Stream is updated even if iPhoto is not running. The goal was to create a script that copies all of the images from many sub-directories into a single folder.

As there are many people who know a lot more about OSX I would welcome improvements and feedback. Some areas to look at:
  • Using 'without replacing' which would only copy the missing pictures.
  • A Folder action which monitors changes and runs the script automatically.
Here's the script:
tell application "Finder"
  set this_folder to "Macintosh HD:Users:duittenb:Library:Application Support:iLifeAssetManagement:assets" as alias
  set target_folder to "Macintosh HD:Users:user:Pictures:MyStream" as alias
  try
    duplicate (every file of the entire contents of this_folder whose name contains "IMG") to the target_folder with replacing
  end try
end tell
Instructions

Replace the target_folder path (underlined above) with your actual destination folder. You can save the script as an application in your /Applications folder or to your Scripts menu.

[crarko adds: Note that you'll also need to modify the this_folder path if your boot drive isn't named 'Macintosh HD.']
  Post a comment  •  Comments (16)  
  • Currently 4.00 / 5
  You rated: 4 / 5 (1 vote cast)
 
[1,491 views] Email Article To a Friend View Printable Version
10.7: Fixing a stuck application in Mission Control System 10.7
I finally upgraded to Lion on my work computer and bid farewell to the wonderful Hyperspaces application. I used all 16 spaces and was loathe to make the jump to Mission Control.

After upgrading many apps were not respecting being assigned to specific desktops or to all desktops. At first I tried unassigning them in the Dock and reassigning them to their previous desktop or all desktops, but it didn't work.

Here is the solution I found:
  • If an app assigned to a particular desktop wasn't staying put, I had to assign it to all desktops, and then reassign it to desktop N.
  • If the app was not respecting assignment to all desktops, I had to assign it to a specific desktop, and then reassign it to all.
Apparently setting it to 'None' does not clear the previous assignment.

[crarko adds: I haven't tested this one.]
  Post a comment  •  Comments (3)  
  • Currently 5.00 / 5
  You rated: 5 / 5 (1 vote cast)
 
[1,170 views] Email Article To a Friend View Printable Version
10.7: HTML5 Video Display Sleep Workaround Web Browsers
The just released OS X 10.7.3 has a new Safari version but the old FDisplay Sleep Issue on HTML5 Video was still not fixed, so I started to look around for a solution and it seems that it is a WebKit Bug, and I made a workaround for this.

Go to the WebKit Project home page and download the latest Nightly Build; it has worked for me so far.

Put it into your Applications Folder and launch, and the browser launches as Safari containing all settings and features, so go to Settings and make WebKit your default browser.

Next download and install the RCDefaultApp PrefPane launch it and go under the application pane to WebKit and enable all file associations and actions.

Safari is no longer the default, now go to the Extensions Pane and search for the safariextz Extension, set it to open with WebKit as well, now you are done, Safari is still there and running if needed, but all actions are now redirected to WebKit, so you are always up to date.

[crarko adds: I haven't tested this one specifically, but many of us have used the WebKit nightly builds as a Safari replacement for a long time. RCDefaultApp is also a well-tested and proven utility, and I recommend it without hesitation.]
  Post a comment  •  Comments (1)  
  • Currently 3.00 / 5
  You rated: 2 / 5 (4 votes cast)
 
[1,224 views] Email Article To a Friend View Printable Version