One of the common steps I have to take with writing posts is getting images pre-loaded to my site so the all the image links can be set properly as I write in my Byword.  For a while I have wanted a way to automatically FTP images to my site and I finally have a working system.  Here are the steps to create your own system.
You will need the following on your Mac:
- OS X Automator (built in to current OS X versions) 
- FTP client 
- Dedicated FTP folder on your site
There is a couple of things to make sure you have done or may need to do. Review this quick checklist before opening Automator.
- Determine the folder you will use on your Mac as your default upload folder. This folder will be the folder Automator will monitor to upload images to your site.
- Determine how/where you want to save the images to your site. This could be a subdomain like
http://share.example.comor a dedicated folder like
http://example.com/images. Just think about how you want this done because you're committing to a strategic process for your site.
- Make sure your FTP account credentials are correct. 
The automatic portion of the work is utilizing a Folder Action via Automator. Use the following steps to create the Folder Action in Automator.
- Open Automator and choose the Folder Action item. This will create a blank Folder Action for you.
Set the folder to the default upload folder you determined as part of your prep work. Mine happens to be
- Start adding the following Actions in order:
- Replace Text
- Add Date or Time
- Get Folder Contents
- Copy to Clipboard
- Upload Files (using FTP client action)
- Run Applescript (first script)
- Run Applescript (second script)
Fill in each of the Actions with the following. Note that on the Replace Text action, the 'Find:' box has a space in it. The idea is rename the image as one continuous string to avoid the unicode %20 filename fillers. 
In the first Run Applescript action, the 2nd line,
set trimFilename to ((characters 40 thru -1 of theFilename) as string)is used to strip the folder path from the file name. You will need to adjust the first numeric value (40 in my example) so only the name of the file is left in the string. The idea is to take the first 40 characters from:
And leave just:
Use the following Applescript to test your string trim setting.
set theFilename to the clipboard set trimFilename to ((characters 40 thru -1 of theFilename) as string) return trimFilename
- In the second Run Applescript action, to easily get the correct path syntax, do the following sub-tasks:
- Open the Applescript editor on one side of your screen and Finder on another.
In the Applescript editor, click on Record button.
In Finder window, under Devices, click on your Mac computer name and then click through the folders until you open the default ftp folder where you'll copy the images to on your Mac.
When you get your ftp upload folder in Finder, click stop in the Applescript editor.
Now you will have an Applescript method to access your ftp upload folder.
Copy the last
set targetstatement and use that as the syntax inside the second Run Applescript action for the Action Folder to set the folder in which the image files should be sent to the Trash.
Now you can test your Action Folder by pasting an image into your selected ftp upload folder. If you keep Finder open to your ftp upload folder you can literally watch as the magic happens. After the Automator action runs, you can just hit paste in your favorite editor and get the URL of the image you just uploaded to your site:@MyGeekDaddy.
- All my posts are written MD and converted to HTML. ↩
- Working != most efficient. Improvements are very likely to be made. ↩
- From my research, this WF should work as far back as Leopard (v10.5.x). ↩
- I'd recommend Fetch of Transmit, both are known to play nicely with Automator. ↩
- Make a mental note that updating or changing your FTP account credentials will break this Automator action. ↩
Folder Actions will be saved in
~/Library/Workflows/Applications/Folder Actions, unless changed when first created. ↩
The idea is to change
My Image Name.pngto
My_Image_Name.png, instead of
Copy the full path and file name (e.g.
/Users/mygeekdaddy/Pictures/ftp_upload2/IMG_7819-Edit.jpg) and test the code in the Applescript editor to get it right. ↩