Created
May 12, 2014 19:38
-
-
Save ciryon/2125b921f756b1e222f7 to your computer and use it in GitHub Desktop.
Notifier on folder add
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on adding folder items to this_folder after receiving added_items | |
property movieExtList : {"mov", "mpg", "mp4"} | |
try | |
tell application "Finder" | |
--get the name of the folder | |
set the folder_name to the name of this_folder | |
set the folder_url to the URL of this_folder | |
end tell | |
-- find out how many new items have been placed in the folder | |
set file_list to "" | |
repeat with this_file in added_items | |
tell application "Finder" | |
--get the name of the folder | |
set the file_name to the name of this_file | |
end tell | |
if the name extension of the this_file is in the movieExtList then | |
set file_list to file_list & file_name | |
end if | |
end repeat | |
set the item_count to the number of items in the added_items | |
if the item_count is greater than 1 then | |
set note_title to (count) & " " & " Torrents Complete" | |
else | |
set note_title to "Torrent Complete" | |
end if | |
tell application id "com.Growl.GrowlHelperApp" | |
set the allNotificationsList to {"Torrent Complete"} | |
set the enabledNotificationsList to {"Torrent Complete"} | |
register as application ¬ | |
"uTorrent Script" all notifications allNotificationsList ¬ | |
default notifications enabledNotificationsList ¬ | |
icon of application "uTorrent" | |
notify with name ¬ | |
"Torrent Complete" title ¬ | |
note_title description ¬ | |
file_list application name ¬ | |
"uTorrent Script" callback URL ¬ | |
folder_url | |
end tell | |
end try | |
end adding folder items to |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment