Automator actions

On Moutain Lion. Okay, I've been looking online but can't quite find what I'm looking for. I want to create a folder action that scans my download folder every time a file is added, and if the file is a torrent, to open Transmission and start. Also it would be nice if I could get Transmission to auto start the torrent rather than bring up the dialogue box that requires me to click add. Just wondering if anyone has any thoughts. Thanks.

You want a Folder Action Script (AppleScript), not an automator action.

Something like this should work:

Code:

on adding folder items to this_folder after receiving these_items tell application "Finder" try repeat with i from 1 to number of items in these_items set this_item to item i of these_items set the item_info to the info for this_item if (alias of the item_info is false and the name extension of the item_info is "torrent") then open this_item end if end repeat end try end tellend adding folder items to

Paste that into /Applications/Utilities/AppleScript Editor and save in ~/Library/Scripts/Folder Action Scripts (create the folders if they don't exist). Then, right-click your Downloads folder (or whatever folder your browser is saving .torrent files into) and select "Folder Actions Setup…". Select your script and you're done. From then on, whenever a file ending in .torrent is added to that folder it will be opened. You may want to disable Transmission's auto-folder-scanning thing so that it doesn't try to open the file itself.

You want a Folder Action Script (AppleScript), not an automator action.

Something like this should work:

Code:

on adding folder items to this_folder after receiving these_items tell application "Finder" try repeat with i from 1 to number of items in these_items set this_item to item i of these_items set the item_info to the info for this_item if (alias of the item_info is false and the name extension of the item_info is "torrent") then open this_item end if end repeat end try end tellend adding folder items to

Paste that into /Applications/Utilities/AppleScript Editor and save in ~/Library/Scripts/Folder Action Scripts (create the folders if they don't exist). Then, right-click your Downloads folder (or whatever folder your browser is saving .torrent files into) and select "Folder Actions Setup…". Select your script and you're done. From then on, whenever a file ending in .torrent is added to that folder it will be opened. You may want to disable Transmission's auto-folder-scanning thing so that it doesn't try to open the file itself.

I have it all set up, but my jobs WiFi blocks any torrent files. I will try when I get home. I had to unhide the ~/Library folder though.