Skip to content

Instantly share code, notes, and snippets.

@g-r-a-v-e-l-y
Last active November 4, 2022 18:56
Show Gist options
  • Save g-r-a-v-e-l-y/1362655 to your computer and use it in GitHub Desktop.
Save g-r-a-v-e-l-y/1362655 to your computer and use it in GitHub Desktop.
An applescript folder action that moves downloaded torrent files to a different directory.
on adding folder items to thisFolder after receiving added_items
mount volume "afp://user@host/share"
delay 1
repeat with addedFile in added_items
tell application "Finder"
if (the name of the addedFile ends with "torrent" or "nzb") then
display notification "Queueing " & (name of addedFile) & "."
try
tell application "Finder"
move addedFile to "spool" with replacing
delete addedFile
end tell
on error
display alert "Unable to move " & (name of i)
end try
end if
end tell
end repeat
end adding folder items to
@SawkeeReemo
Copy link

Oh cool. Thanks for sharing that! I’m going to dig in on that later. I’m still learning scripting, but have managed to make some pretty cool automations. Thanks for sharing this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment