Finally some code that actually works! Users have said that this code works for AppleScript version 2.0.1, and x.x. See more details below
Do you think that this code could be better? Great!
Go ahead and improve it.
Click here to do so.
Confirm that this code works for you or your version of AppleScript. If it doesn't work then tell everyone that too. Feedback is the only way that we are going to improve this code.
This AppleScript moves 1 file to a FTP site using a shell script command. The script can be easily modified to do more complex tasks.
This is the not the most current version. See the version history here
(* * Simple FTP Applescript * * Description: This AppleScript moves 1 file to a FTP site using a shell script command. * The script can be easily modified to do more complex tasks * * Confirmed: This AppleScript works on Mac OS X (Version 10.4.11) * *) ------- -- Your FTP Variables (adjust for your needs) property server1 : "ftp.yoursite.com" --Enter in your server name property targetDir1 : "public_html/test" --Enter in your folder name property username1 : "password" --Enter in your username property password1 : "username" --Enter in your password -- Your filename variables property PathName : "/Users/Name/Desktop/ftptest" --Enter in the pathname of the file you wish to move property FileName : "test.txt" --Enter in the filename of the file you wish to move -- Hard code variables (do not touch) property newline : ASCII character 10 -- Create the commandline script to ftp your file set command to "ftp -n " & server1 & " << eof > /tmp/ftpUploadLog user " & username1 & " " & password1 & " cd " & targetDir1 & newline & " binary" & newline & "lcd \"" & PathName & "\"" & newline & "send \"" & FileName & "\"" & newline & "quit" -- Display a dialog of the command you are about to execute (this can be commented out) display dialog command -- Run the Shell Script do shell script (command) -- All done!Download | Improve | Share
This AppleScript is simple to run.
Step 1: Open this AppleScript in the Script Editor on your Mac.
Step 2: Set the Variables at the top of the AppleScript for the file you will need to adjust the FTP Variables and the filename variables..
Step 3: Hit the "Run" button in your Script Editor
That is it. You can use these functions in any of your others AppleScripts.