Aug 21, '06 07:30:05AM • Contributed by: pglock
My 10-year-old daughter is putting together her own simple website. The authoring tools and process need to be as simple as possible, and she's happy with the whole iLife package so iWeb seems to be the way to go. I have spare space on a linux webserver, so I don't want to use .Mac. As a result, I've been ftp'ing her files up to the server using Transmit.
I'm trying to avoid being 24x7 tech support, so I was looking for ways to automate the iWeb 'Publish to a Folder' export followed by the FTP transfer. I've used a combination of Automator (Transmit supports Automator actions) and AppleScript as a folder action to:
- Watch the username/Sites folder for added files
- Wait 20 seconds after files are changed to trigger the action
- Mirror the Sites folder via Transmit with the web server
- Delete the contents of the Sites folder after upload
The AppleScript attached as the folder action is:
on adding folder items to this_folder after receiving added_items
tell application "Path:to:Autmoator:action"
open added_items
end tell
try
tell application "Finder"
try
delete (every item of folder "Sites" of ¬
folder "username" of folder "Users" of startup disk)
end try
end tell
end try
end adding folder items to
The Automator action contains the FTP login, so I won't post it here, but I'll make a screenshot available on my own site. It's only a two-step workflow:
- Automator Library, Pause Action -- 20 seconds
- Transmit Library, Synchronize Files Action -- Sync Direction upload, Sync Method mirror.
