I have searched lots on here but cant find a simple answer. Here is what i would like to do.
Once a file is is finished compressing and lands in a folder i have specified, I want it to automatically upload to an ftp server (and folder) of my choice and then send an email to the client telling him its up. This possible?
I have figured out in automator with Transmit how to sync a folder with a folder on my ftp. But it does not constantly watch the folder for new files. So if I could figure out how to tell this automator workflow how to watch the folder and then sync that would be as good. thanks for any help. Im new to applescripts and have done a bit in automator. thanks.
property serverPath : "ftp.mydomain/path/to/folder/"
property user_name : "myName"
property pass_word : "¢¢¢¢¢"
property theName : "John Doe"
property theAddress : "john@doe.com"
on adding folder items to this_folder after receiving added_items
repeat with this_item in added_items
do shell script "curl " & quoted form of serverPath & " -u " & user_name & ":" & pass_word & " -T " & quoted form of POSIX path of this_item
sendMail(name of (info for this_item))
end repeat
end adding folder items to
on sendMail(theSubject)
tell application "Mail"
set newMessage to make new outgoing message with properties {visible:true, subject:theSubject & " is available"}
tell newMessage
make new to recipient at end of to recipients with properties {name:theName, address:theAddress}
end tell
activate
send newMessage
end tell
end sendMail
so i just apply this to a folder? via folder action? and once a new file is placed in there it will upload?
I just took your code and pasted it into the script editor and added my info. saved as a script. i right cliced on a folder and added this action. thats it?