Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Synch iCal via FTP using Transmit Apps
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 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 "" 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, username, and yourpassword. I have not tested the hint as a whole...]
  • Currently 3.00 / 5
  You rated: 5 / 5 (3 votes cast)

Synch iCal via FTP using Transmit | 13 comments | Create New Account
Click here to return to the 'Synch iCal via FTP using Transmit' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Synch iCal via FTP using Transmit
Authored by: jcbeckman on Mar 03, '05 09:28:53AM

I guess I don't understand why you wouldn't just publish the calendars with iCal via webdav. That what I do to get them to phpicalendar. No extra scripting required, just fill in the dialog box.

[ Reply to This | # ]
how to publish with iCal?
Authored by: newformula on Mar 03, '05 09:55:07AM

Could you explain how you get phpicalendar to do this? I have tried but to no avail. Details on what to input in the publish box would be great, and if you changed any permissions on your server as well. I was under the impression that you have to enable php write access to your calendars folder, and I have no idea how to do this!

[ Reply to This | # ]
how to publish with iCal?
Authored by: jcbeckman on Mar 03, '05 02:10:25PM

I use Panther Server, so it was just a matter of making a "realm" on my server that pointed to the calendars directory in phpicalender. Then in iCal you fill in the "publish" dialog with webcal://

iCal will ask for the username and password.

[ Reply to This | # ]
Just copying the .ics files might lose data
Authored by: tjp on Mar 04, '05 02:31:06AM

I have to reinforce the suggestion to use the phpicalendar publish.php method over FTP. I've done a fairly large phpicalendar implementation for a public site with calendar data managed by a number of people with varying technical skill levels. We tried a variety of methods for delivering .ics files to the webserver, including AFP mounts and FTP. We found that, over time, recent calendar data was missing from the posted calendar files. After looking more closely, I found that there are a number of cache files within the user's Library folder that are separate from the main Library/Calendars/*.ics files and show more recent modification times than the main files at times.

I never took the time to prove it for sure, but strongly suspect that issues of timing along the lines of "are the files copied while iCal is running," or perhaps simply user error poking around with the files were the cause. I shifted over to publish.php in iCalendar 1.0 and had no problems with missing data since. Who knows, this behavior could change from one rev of iCal to the next, but that's part of the point. You can be pretty sure that Apple's going to make sure the publish function within the app is going to submit all of the latest data, no matter how it's implemented.

And, if that wasn't even a concern, the interface couldn't be easier using the publishing method. Once the webdav publishing is configured, you can have the calendars automatically published on any change, any changed calendar can be published with a simple cmd-R while it's active or all calendars published with shift-cmd-R.

Works great, lasts a long time.

[ Reply to This | # ]
Just copying the .ics files might lose data
Authored by: dogboy on Mar 07, '05 04:52:02PM

Fair enough. I have moved to this now. The hint was a result of many wasted hours trying to find a way to publish my iCalendars without Webdav or .Mac.

[ Reply to This | # ]
Synch iCal via FTP using Transmit
Authored by: geekpunk on Mar 04, '05 09:10:28AM

agreed... i use phpicalendar... using web dave and its dead simple...

if your running apache look at the docs, for apache 2, its literaly 1 directory directive to turn on webdav, do so for the caldendars folder in your phpicalendar install.

Then you subscribe/publish from ical change from .mac to webdav... fill in the blanks and your ready to go.... updates as you update etc

[ Reply to This | # ]
Synch iCal via FTP using Transmit
Authored by: Nikolay Komarov on Apr 21, '06 01:59:43AM

It's not as easy as you say!
iCal itself doesn't support remote calendars, and if you publish some calendar to subscrobe to t from some other computer, your calenar will be read-only there.
The only known workaround for this is mounting a remote webDAV-share and putting this folder instead of the iCal's working folder (described here: )

[ Reply to This | # ]
Synch iCal via FTP using Transmit
Authored by: goatbar on Mar 03, '05 09:57:00AM

Arg... please do not advocate ftp. I have spent too much time fixing people's machines after they get hacked when they had their passwords sniffed via ftp.

Other than that, this is a great tip. I was playing with the same thing a while back. My solution would be to use rsync with an ssh key and a cron entry. Or better yet would be to use anacron (which I've never done myself)

phpicalendar is very cool in how easy it was to just plunk calendars in a directory and have it just work.

[ Reply to This | # ]
FTP script to do the same...
Authored by: newformula on Mar 03, '05 09:59:08AM

I also have an ftp script which you can use to do the same thing, no transmit needed.

HOST='your host goes here'

quote USER $USER
lcd /Users/kmason/Library/Calendars
cd public_path to phpical calendars folder
put $FILE1
exit 0

This can be edited for multiple files, just add FILE2, FILE3 etc lines as needed in the put section and in the top section on the script. Hope that makes sense.

Remember to make executable.

[ Reply to This | # ]
Authored by: newformula on Mar 03, '05 10:00:38AM

I left my user path in there. Remember to change it to your own!

[ Reply to This | # ]
FTP script to do the same...
Authored by: peragrin on Mar 03, '05 02:19:04PM

I use a stripped down version of that to ftp my bookmarks to my website. There is a plus to Mozilla/firefox's bookmarks in a single HTML file. World wide access in a small script.

I wouldn't use ftp to a personal machine. It's just not secure enough.

I thought once I was found but it was only a dream

[ Reply to This | # ]
FTP script to do the same...
Authored by: seancorfield on Mar 05, '05 05:05:50PM

Or, even shorter:

cd ~/Library/Calendars
ftp -V -u ftp://USER:PASSWD@REMOTEHOST/PATH/ myCal.ics 2>&1 > /dev/null

"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood

[ Reply to This | # ]
Sync iCal via FTP using Transmit
Authored by: jweinberger on Mar 04, '05 02:04:29PM
This is a great hint - thanks!

I was working on a similar, but more generalized sync also with the new features of Transmit. That will sync anything to/from and FTP server or iDisk or webDAV (OK, anything Transmit will connect to. Look here for that script

One very important additional note (applies to both scripts): This requires Transmit 3.0.2. It WILL NOT work with earlier versions (not even 3.0.1) due to an applescripting bug which was fixed (Thanks to Ian and Cabel at Panic - great work!) in 3.0.2.

You'll also see that I make the servers I sync to by scripting into favorites. It does not make FTP more secure, but it does avoid hardcoding your password into the script, which made me uncomfortable.

Hope that helps someone!

[ Reply to This | # ]