Scripting Palm Desktop export?
Scripting Palm Desktop export?
- Subject: Scripting Palm Desktop export?
- From: Nicholas Riley <email@hidden>
- Date: Sun, 25 May 2003 23:05:12 -0500
Hi,
I'm attempting to write a script to export my Palm Desktop addresses
and contacts as vCal and vCard, respectively, for use on my iPod.
Since the Export command was obsoleted in 4.1 instead of being made
useful, I can't do this directly with AppleScript. Generating vCal
myself is something I don't want to do - I've already written
iCalendar generation for to dos since Palm Desktop doesn't export
them. Especially modeling the repeating behavior will be nightmarish,
and why do it when Palm Desktop generates perfectly reasonable
vCal/vCards already?
So I resorted to UI Scripting, but it doesn't work either - because,
for some reason, my selections from the pop-up menus aren't
registered. Here's an example:
on sync_events()
local calendars_folder
set calendars_folder to get_iPod_folder("Calendars")
try
tell application "Finder" to delete file events_file of calendars_folder
end try
do_export()
tell application "System Events" to tell window "Export: Palm Desktop" of process "Palm Desktop"
keystroke "a" with command down
keystroke POSIX path of calendars_folder & (ASCII character 13) & events_file
if value of pop up button 3 is not "Date Book" then error "?Date Book? not selected"
tell pop up button 1
click
tell menu 1 to click menu item "vCal"
end tell
keystroke (ASCII character 13)
end tell
end sync_events
The result of this is that vCal is selected after a delay (why the
delay?), but the dialog box does not update as if I selected it
myself, and a text file is exported. Is this a problem with Palm
Desktop or UI Scripting?
If you want to see the whole script, it's here:
<
http://web.sabi.net/temp/hipSync.scpt> (AppleScript)
<
http://web.sabi.net/temp/hipSync.html> (formatted text version)
My last resort is to move my code from AppleScript into Python or
Objective-C and generate vCal myself, but that'd slow things down by
several orders of magnitude trying to get all my data via Apple
Events, or transforming the exported CSV file somehow.
Please tell me there's another way - since Apple advertises Palm
Desktop support for the iPod you'd think there'd be such a script
written already!
Thanks,
--
=Nicholas Riley <email@hidden> | <
http://www.uiuc.edu/ph/www/njriley>
Pablo Research Group, Department of Computer Science and
Medical Scholars Program, University of Illinois at Urbana-Champaign
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.