Automating the Amazon MP3 Downloader

Sunday, December 2nd, 2007 @ 9:27 pm | AppleScript

It’s Amazon day at, as I finally got around to trying Amazon MP3 and the Amazon MP3 Downloader app. At first, I wasn’t seeing the downloader launch automatically, then it dawned on me that said behavior was probably tied to Safari’s Open “safe” files after downloading preference.1

Between security concerns and general annoyance, I’d turned this feature off some time ago. In Amazon’s case, I actually wanted this functionality. A short AppleScript later and I had a working solution.

on adding folder items to this_folder after receiving added_items
    repeat with item_ in added_items
        tell application "Finder"

            if name extension of item_ is "amz" then
                open item_
            end if

        end tell
    end repeat
end adding folder items to

Save the script to ~/Library/Scripts/Folder Action Scripts/. In the Finder, navigate to your downloads folder, select Attach a Folder Action… from the contextual menu, and locate your newly saved script in the resulting file selection dialog. Now, whenever you download a new amz file from Amazon MP3, the Amazon MP3 Downloader will launch. Nothing earth-shattering, but I found that it improved the shopping experience.

Should you at some point activate the Open safe files… option in Safari, I’d recommend disabling this folder action. I haven’t done any testing, so I don’t know how well using both would or would not work.

  1. Yeah, putting “safe” in quotes sounds really reassuring. []

Comments are closed.