Synch iCal via FTP using Transmit

Mar 03, '05 07:29:00AM

Contributed by: dogboy

I've been looking for a way to use my iCal calendars on the internet. I don't use .Mac, and I dont want to share neccessarily. I just want access to my calendars and to be able to let others see them, too. This hint requires Transmit 3 (or another scriptable FTP program), and a copy of PHPiCalendar, which is free and runs on your web sever (it requires PHP, obviously). I initially had trouble, as there is no AppleScript command to export calendars, but then I found the calendars in ~/Library/Calendars.

I also have some big Calendars (1MB plus) which I subscribe to and which are static, and don't need to be uploaded over and over. My solution was to create a new local folder (I called mine 'CalAlias'), and place aliases of the folder(s) I wanted to synch in there.

Then I wrote a very simple AppleScript (an adaptation of one from Panic.com) which uses Transmit to synch (or rather upload and mirror) this folder. It seems Transmit resolves the aliases to the files. I don't know if this is the case with other FTP clients. As PHPiCalendar automatically displays any calendar in its directory, just uploading these files is enough. You may want to password protect the folder on your server, and give the password to anyone you want to have access to your movements.

Here's the script. I have mine hooked into Salling Clicker, so it runs when I leave the house. However, it might be neat to have iCal run the script for you, for added recursive satisfaction.

tell application "Transmit"
  -- Create a new session window for the script
  make new document at before front document
  set SuppressAppleScriptAlerts to true
  -- send commands to the frontmost document window
  tell current session of document 1
    connect to "ftp.yoursite.com" as user "username" with password "yourpassword"
    --Set your stuff listing to "Sites" folder
    set your stuff to "/Users/yourusername/Library/CalAlias/"
    set their stuff to "/path/to/your/phpicalendar/folder"
    (*
    Begin synchronizing modified remote files with local files
    Can specify the direction and method Transmit uses for synchronizing.
    Direction can be: upload files / download files
    Method can be: update / mirror
    *)
    synchronize method mirror direction upload files with time offset 0
  end tell
end tell
[robg adds: This script compiles correctly -- but only if you have Transmit 3; it won't work with earlier versions. Also, remember to modify it for your server, replacing ftp.yoursite.com, username, and yourpassword. I have not tested the hint as a whole...]

Comments (13)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20050301122805744