Skip to content

Instantly share code, notes, and snippets.

@pung96
Created May 12, 2012 00:04
Show Gist options
  • Save pung96/2663209 to your computer and use it in GitHub Desktop.
Save pung96/2663209 to your computer and use it in GitHub Desktop.
on open theseFiles
set listSize to count of theseFiles
set counter to 1
set results to ""
tell application id "com.Growl.GrowlHelperApp"
set the allNotificationsList to {"Uploaded"}
set the enabledNotificationsList to {"Uploaded"}
register as application "PicasaUploader" all notifications allNotificationsList default notifications enabledNotificationsList icon of application "Script Editor"
notify with name "Uploaded" title "Start Picasa Upload" description "( " & listSize & " ) File(s)" application name "PicasaUploader"
repeat with thisFile in theseFiles
set theFileName to POSIX path of (thisFile)
set myResult to do shell script "export PERLBREW_HOME=~/perl5/perlbrew; source ~/perl5/perlbrew/etc/bashrc;$HOME/bin/picasa-upload.pl " & quoted form of theFileName
notify with name "Uploaded" title "Uploaded" description "(" & counter & "/" & listSize & ")" & theFileName application name "PicasaUploader"
set results to results & myResult & return
set counter to counter + 1
end repeat
set the clipboard to ((results) as text)
notify with name "Uploaded" title "Uploaded" description "" & listSize & " Files are uploaded" application name "PicasaUploader"
end tell
end open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment