Dear All, please help me out here, my little folder action script doesn´t work although I have tried almost everything here in the list.
I want to make a simple Folder Action to just monitor my Downloads folder and move .torrent files to my Dropbox folder. It should be simple, but neither using name extension or info for seems to work.
This is how I wrote the script so far:
on adding folder items to thisFolder after receiving added_items
tell application "Finder" to repeat with i from 1 to number of items in added_items
set this_item to item i of added_items
set the item_info to the info for this_item as text
tell application "Finder"
if item_info contains "torrent" then
move this_item to folder "Macintosh HD:Users:Me:Dropbox:Torrents:" with replacing
end if
end tell
end repeat
end adding folder items to
I know that this has been up before, and I have tried those solutions too but nothing. I have a new MacBook Pro running OSX 10.6.2 and I believe I have properly configured the folder action, has the script located in the Library/Scripts/Folder Action Scripts etc.
Please give me a hand as to why it does not work?
Model: Macbook Pro
AppleScript: 2.1.1
Browser: Safari 531.21.10
Operating System: Mac OS X (10.6)
on adding folder items to thisFolder after receiving added_items
repeat with i in added_items
-- Path to torrents folder
set DropboxTorrents to (POSIX file "~/Dropbox/Torrents/") as string
-- if filename contains the torrent extension
tell application "Finder" to if (name of i) contains ".torrent" then move i to alias DropboxTorrents
end repeat
end adding folder items to
Thank you all for responding!
The final solution that solved my issue was the one proposed by StefanK. Thanks!
on adding folder items to thisFolder after receiving added_items
repeat with i in added_items
-- Path to torrents folder
set DropboxTorrents to (path to home folder as text) & "Dropbox:Torrents:"
-- if filename contains the torrent extension
tell application "Finder" to if (name of i) contains ".torrent" then move i to alias DropboxTorrents
end repeat
end adding folder items to
Model: Macbook Pro
AppleScript: 2.1.1
Browser: Safari 531.21.10
Operating System: Mac OS X (10.6)