I am trying to write an Applescript Studio program that can make it much easier for me to upload files (via FTP) to my personal webspace. I want to be able to drag files onto my application, and have a window come up asking me what I would like to name the uploaded file (in a text box). However, when I drag a file onto my app, I get the error that “posix_file” is not defined. Any help would be greatly appreciated!
on open upload_file
set posix_file to POSIX path of upload_file
end open
on clicked theObject
if the name of theObject is equal to "upload_button" then
set upload_dir to contents of text field "directory_box" of window "main_window"
do shell script "curl -T " & posix_file & " ftp://<username>:<password>@upload.comcast.net/" & upload_dir
else if the name of theObject is equal to "cancel_button" then
quit
end if
end clicked