Yummy FTP can be automated to perform repetitive tasks using a set of AppleScript commands, which can be entered into a script file, using the Script Editor application that is installed in your Applications folder (within an AppleScript folder).
The Script Editor application can also be used to record actions that you perform with Yummy FTP, creating a script containing the necessary AppleScript commands to repeat those actions. This function can be especially useful to see how scripting works and to provide a basis for any script that you would like to write.
Once an AppleScript script has been created, it can be attached to an Automator workflow, or it can be saved as a standalone double-clickable script-application, or the script can be attached to any application which supports the attachment of scripts.
Below is the Yummy FTP AppleScript dictionary, listing all the commands that Yummy FTP will accept.
All applications support these commands
Open the selected files
Syntax: open string : Full path to a file or folder, or a list of files and folders
Note: This command performs two functions in Yummy FTP:
Exit the application
Syntax: quit
These are the commands that Yummy FTP provides to connect with servers, transfer files and perform other file management tasks, including synchronization.
Establish a connection using an existing Bookmark
Syntax: connect string : Bookmark name
Result: 0 = Connection established 1 = Failed to initiate connection 2 = Named Bookmark not found 3 = Connection attempt failed
Instruct the specified connection to perform a task
Syntax: using connection string command string : Connection name, command, item specifier
Result: 0 = Task completed successfully 1 = Named connection not found 2 = Named connection already busy 3 = Task failed
Disconnect and close the connection named Specify the connection name
Syntax: disconnect string : Connection name
Result: 0 = Disconnection successful 1 = Named connection cannot be found 2 = Disconnection failed
These commands have become the standard in all Mac applications that are Internet orientated, and are simplistic ways to upload or download a file or folder, or view a server directory.
Send the specified files/folders to the server and directory described by the url parameter
Syntax ” UploadURL string with list : Specify a fully qualified URL that points to a directory
Result: 0 = Successful 1 = Provided URL was faulty 2 = Unable to initiate connection 3 = Unable to resolve provided URL
Fetch or display the specified URL
Syntax : GetURL string : Specify a fully qualified URL that points to a file or directory If a file is specified it will be downloaded If a directory is specified it will be displayed
Result: 0 = Successful 1 = Provided URL was faulty 2 = Unable to initiate connection 3 = Unable to resolve provided URL
tell application "Yummy FTP" activate connect "Bookmark name" using connection "Bookmark name" list local folder "/Users/yummyftp/My Downloads" using connection "Bookmark name" list remote folder "/www/files/latestsources" using connection "Bookmark name" download "*" disconnect "Bookmark name" end tell
In the above example, the following will occur:
Some operations can be quite lengthy, such as downloading a large file. In this case it is possible for the standard AppleScript command timeout of 2 minutes to be exceeded and the script will fail. In this case, specify a *with timeout* around the script, such as below:
with timeout of 32766 seconds using connection "Bookmark name" download "Hugefile.VOB" end timeout