Deprecated: Assigning the return value of new by reference is deprecated in /home/yummyftp/www/www/wiki/inc/parserutils.php on line 159

Deprecated: Assigning the return value of new by reference is deprecated in /home/yummyftp/www/www/wiki/inc/parserutils.php on line 162

Deprecated: Assigning the return value of new by reference is deprecated in /home/yummyftp/www/www/wiki/inc/parserutils.php on line 292

Deprecated: Function split() is deprecated in /home/yummyftp/www/www/wiki/inc/auth.php on line 103

Warning: Cannot modify header information - headers already sent by (output started at /home/yummyftp/www/www/wiki/inc/parserutils.php:159) in /home/yummyftp/www/www/wiki/inc/auth.php on line 191

Deprecated: Function split() is deprecated in /home/yummyftp/www/www/wiki/inc/common.php on line 552

Warning: Cannot modify header information - headers already sent by (output started at /home/yummyftp/www/www/wiki/inc/parserutils.php:159) in /home/yummyftp/www/www/wiki/inc/actions.php on line 239
====== AppleScript Scripting ====== 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. ===== Dictionary ===== Below is the Yummy FTP AppleScript dictionary, listing all the commands that Yummy FTP will accept. ==== Required Suite ==== All applications support these commands === open === 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: * If a Bookmark file from Yummy FTP or another FTP client is specified then a connection will be established using those details * If items within an AutoRoute enabled local folder are specified, the appropriate Bookmarked connection will be opened and the items uploaded to their respective directories === quit === Exit the application Syntax: quit ==== Yummy FTP Suite ==== These are the commands that Yummy FTP provides to connect with servers, transfer files and perform other file management tasks, including synchronization. === connect === 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 === using connection === Instruct the specified connection to perform a task Syntax: using connection string command string : Connection name, command, item specifier *** download ** : Download items (Specify file/folder name, or * for all items) *** upload anything ** : Upload items (Specify a file/folder name, a full path, a list of files, or * for all items) *** to destination ** : The full path to the folder into which items will be transferred *** list local folder ** : Display the contents of the specified folder (Specify the name of a currently displayed folder, a full path or Home for the default location) *** list remote folder ** : Display the contents of the specified folder (Specify the name of a currently displayed folder, a full path or Home for the default location) *** create remote folder ** : Makes an empty folder within the currently displayed server folder (Specify new folder name) *** create local folder ** : Makes an empty folder within the currently displayed local folder (Specify new folder name) *** update listing ** : Refresh the file listing of the current folder (Specify local or remote) *** delete local item ** : Permanently remove a local file/folder (Specify item name or * for all items) *** delete remote item ** : Permanently remove a remote file/folder (Specify item name or * for all items) *** rename local item ** : Assign a new name to a local file/folder (Specify item name to be renamed) *** rename remote item ** : Assign a new name to a remote file/folder (Specify item name to be renamed) *** to ** The new name an item being renamed *** move local item ** : Move items from one folder to another (Specify item name or * for all) *** move remote item ** : Move items from one folder to another (Specify item name or * for all) *** into ** : The full path to a new location of an item being moved *** set encoding ** : Set encoding for subsequent transfers (Specify Auto, ASCII, Binary or MacBinary) *** set mode ** : Set file replacement for subsequent transfers (Specify Prefs, Unique or Replace) *** send ftp command ** : Send an FTP command directly to the server as if using the command line *** synchronize ** : Synchronize local and remote directories (Specify Update Server, Update Mac or Mirror) *** delete orphans ** : Control whether orphaned items are deleted during Synchronize operations (Specify Yes or No) Result: 0 = Task completed successfully 1 = Named connection not found 2 = Named connection already busy 3 = Task failed === disconnect === 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 ==== URL Suite ==== 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. === UploadURL === Send the specified files/folders to the server and directory described by the url parameter *** with ** list : A list of files/folders to upload 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 === GetURL === 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 ===== An Example Script ===== 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: * Launch Yummy FTP if not already running * Bring Yummy FTP to the foreground * Open an FTP Browser connection using the named Bookmark * Set the Mac browser to list the folder "My Downloads" located in the Home folder of the user "yummyftp" * Set the Server browser to list the directory "latestsources" which is located in the full path "/www/files/" * Download all the files in the the "latestsources" directory to the "My Downloads" folder * Disconnect from the server and close the FTP Browser window ===== Usage Tips ===== 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