|
#1
| |||
| |||
| Automator: Building an FTP Workflow I realize to the Automator pros this is dead simple, but for a newbie I am having a heck of a time. All I want to do is build a workflow that... 1) downloads (to my local system) two files from my FTP site 2) uploads those same two files to a different location on my FTP site I've come close, but when the files are saved to my local system instead of being saved as sitemap.xml (as it should) it is being saved as: Sitemap\files\sitemap.xml, which is my FTP path. I suppose I could add the rename feature in the workflow, but I would think I should be able to save the files correctly. Or better yet, not even have to save to my local system. Anyone help the challenged? ![]() |
|
#2
| ||||
| ||||
| Have you tried using Transmit as your FTP program? I believe it has some Automator actions available with/for it. |
|
#3
| ||||
| ||||
| FTP in the Finder is read only. Take a look at this; http://docs.info.apple.com/article.html?artnum=107415 I can't help with this, just doing some searching for you. Go here; http://discussions.apple.com/index.jspa Open the Tiger Forum then 'Automator' and post this in there. A lot of folks there with experience may be able to help. Also, go to the; http://bbs.applescript.net/ forum and open the Automator forums. A lot of very good folks there. Hope this helps.
__________________ Last edited by bobw; November 5th, 2006 at 09:37 AM. |
|
#4
| |||
| |||
| While there are FTP applications that have associated 'Automator' actions and / or AppleScript scripts - either by the applications' creator(s) or others ... there are also other ways to download and / or upload via FTP files - without any application(s). Place the following code in to a 'Script Editor' window, or into an 'Automator's 'Automator' library 'Run AppleScript' action panel - ----- Code starts here. set user_Name to "your_user_name" - User Name. set pass_Word to "your_password" -- Password set file01 to "file01.ext" -- File to download. set file02 to "file02.ext" -- File to download. set tDirectory to "upload_directory" -- Directory to upload to. set bURL to "ftp_Server_Address" -- FTP server. set tDate to do shell script ("date +%Y%m%d/") try do shell script ("mkdir $HOME/Desktop/" & tDate & "/") end try -- Download file01. try do shell script ("curl ftp://" & user_Name & ":" & pass_Word & "@" & bURL & "/" & file01 & " >> " & "$HOME/Desktop/" & tDate & "/" & file01) end try -- Download file02. try do shell script ("curl ftp://" & user_Name & ":" & pass_Word & "@" & bURL & "/" & file02 & " >> " & "$HOME/Desktop/" & tDate & "/" & file02) end try -- Upload file01. try do shell script ("curl -T $HOME/Desktop/" & tDate & "/" & file01 & " -u " & user_Name & ":" & pass_Word & " ftp://" & bURL & "/" & tDirectory & "/") end try -- Upload file02. try do shell script ("curl -T $HOME/Desktop/" & tDate & "/" & file02 & " -u " & user_Name & ":" & pass_Word & " ftp://" & bURL & "/" & tDirectory & "/") end try ----- Code ends here. ... Or, instead - with 'Automator', create an 'Automator' library 'Run Shell Script' panel, and place the following code into it. ----- Code starts here. #!/bin/bash user_Name="your_user_name" # User Name. pass_Word="your_password" # Password file01="file01.ext" # File to download. file02="file02.ext" # File to download. tDirectory="upload_directory" # Directory to upload to. bURL="ftp_Server_Address" # FTP server. tDate=$(date +%Y%m%d) mkdir $HOME/Desktop/$tDate/ # Download file01. curl ftp://$user_Name:$pass_Word@$bURL/$file01 >> $HOME/Desktop/$tDate/$file01 # Download file02. curl ftp://$user_Name:$pass_Word@$bURL/$file02 >> $HOME/Desktop/$tDate/$file02 # Upload file01. curl -T $HOME/Desktop/$tDate/$file01 -u $user_Name:$pass_Word ftp://$bURL/$tDirectory/ # Upload file02. curl -T $HOME/Desktop/$tDate/$file02 -u $user_Name:$pass_Word ftp://$bURL/$tDirectory/ ----- Code ends here. Basically, two files at the root level of the FTP server are downloaded into a created folder (of the current date) on the 'Desktop'. The downloaded files are then uploaded to the FTP server - into its 'upload_directory' directory. |
![]() |
| Thread Tools | |
|
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Automator - workflow help | willibook1.42 | Mac OS X System & Mac Software | 2 | October 9th, 2006 12:43 AM |
| Can I create this workflow with Automator or Applescript? | Jean-Marc Zucze | Mac OS X System & Mac Software | 3 | December 6th, 2005 05:48 PM |
| Automator Workflow error - Help for the inexperienced scripter? | JeffCGD | Mac OS X System & Mac Software | 1 | November 24th, 2005 04:55 AM |
| Automator Workflow Newbie | frozendice | Software Programming & Web Scripting | 0 | October 6th, 2005 08:30 PM |
| Automator workflow doesn't work as Plugin | IslandJordan | Mac OS X System & Mac Software | 3 | June 28th, 2005 03:55 PM |