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

Sync iCal to iPod via shell script Apps
Stupid me, spent so much time trying to figure out how to do it in AppleScript, totally forgotten that Script Menu.menu does UNIX shell scripts as well ... so here's a script to automate the iCal to iPod calendars syncing.

Anyone wants to supply an AppleScript version? I'd sure like to figure out how it can be done in AppleScript.

Enjoy.
    •    
  • Currently 3.75 / 5
  You rated: 5 / 5 (4 votes cast)
 
[4,949 views]  

Sync iCal to iPod via shell script | 3 comments | Create New Account
Click here to return to the 'Sync iCal to iPod via shell script' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
how to do it with applescript
Authored by: netsmiley on Sep 21, '02 01:39:21PM
well, i poked around in applescript for a few minutes, and here's what i can figure. disclaimer: i don't have an iPod, so i could only kind of test this with a disk image... if anyone wants to send me an iPod, i'd be happy to test it further :p

tell application "Finder"
set theDisks to the name of every disk
repeat with i from 1 to the number of items in theDisks
set thisDisk to item i of theDisks
if disk thisDisk is local volume and disk thisDisk is ejectable then
if folder "iPod_Control" of disk thisDisk exists then
--display dialog thisDisk & " is the disk"
copy entire contents of folder "Calendars" of folder "Library"
¬ of home to folder "Calendars" of disk thisDisk
end if
end if
end repeat
end tell

(or you can download it from here if that looks too messy. if you copy&paste this, recombine the lines that start "copy entire contents" and "of home to" so they're one line)


[ Reply to This | # ]
Did I miss the point?
Authored by: piper on Sep 21, '02 06:21:04PM

Okay, so maybe I missed the point to this hint, but isn't the easiest way (at least until iSync is released) to just use the Export command from iCal?

Open iCal and plug in and mount your iPod.
From iCal, go to the File menu and choose Export.
Choose /iPod/Calendars as the location to which to export your calendar.ics file.

Done.

I suppose that if you had an AppleScript that could recognize when you mount an iPod it could do the export (or copy the ICS files) for you... but it doesn't look like your shell script does that.

Then again, maybe I'm an idiot - it IS one of those days!



[ Reply to This | # ]
you *can* trigger it on iPod connect
Authored by: netsmiley on Sep 22, '02 03:07:13AM
found this at versiontracker while i was trying to figure out how to wait for iPod connections to occur: MooSB can trigger events when a device is attached to the firewire bus. If the script fires when a non-iPod is attached, nothing happens and you go no your merry way. If it *is* an iPod, your calendar gets synced, boom. seems like a nice effect to me.

[ Reply to This | # ]