How to access Palm Desktop (version 4.2.1) Applescript Dictionary?

Hi all,

I can’t seem to find a way to access the Palm Desktop 4.2.1 dictionary. When I load up the Script Editor, and selected Open Dictionary …, the editor will list many other applications, but does not list the Palm Desktop. It also has a browse button, but I can’t seem to locate the Palm dictionary at all. I’ve already downloaded the PDF dictionary (version 4.1) from this site, but I can’t be sure that it’s the same as version 4.2.1.

Here’s my situation: I need to script the Palm Desktop to export events titled “Daily Journal” in the “Journal” category out to Macjournal.

I’m just barely learning to script on the Mac OS X, and would appreciate any help.

Thank you very much!

And in case I get kicked out of this forum for having a Vietnamese last name (such as Do or Le) because this system is triggering it as a false profile, then please send replies directly to vhtran4-pro@yahoo.com. Thanks again!

Model: iMac G5, Powerbook G5
AppleScript: 1.10.6
Browser: Safari 417.9.3
Operating System: Mac OS X (10.4)

To access the Palm AS dictionary:

Go to Script Editor, choose Open Library, then click the Browse button. Go to Applications, choose the Palm folder, then select the Palm Desktop application.

Personally, I have placed my Palm dictionary on my library bookshelf (Script Editor → Window → Library) for easy access. I can help you script the extraction of event from your Palm Desktop, but I know nothing about Macjournal.

Here are a couple of scripts to get you started. When searching for events within a certain category, it is best to use the category id number, so this first little script will generate a list of every available category by name and id number:


set all_Cats to {}
tell application "Palm Desktop"
	set a to every category
	repeat with b in a
		set end of all_Cats to {b's id, b's name}
	end repeat
end tell
all_Cats

-->{{24, "Boy Scouts"}, {1, "Business"}, {9, "Cathouse/Bus."}, {28, "Cathouse/Prof."}, {23, "Christmas"}, {25, "Church"}, {30, "Cindy"}, {27, "Commissioners"}, {18, "Computing"}, {14, "Crossword"}, {2, "Customers"}, {15, "Family"}, {26, "Friends"}, {3, "Friends/Family"}, {29, "Holiday"}, {10, "Information"}, {17, "Parables"}, {4, "Personal"}, {21, "Pet Doctor"}, {5, "Phone Call"}, {12, "Photos/Films"}, {16, "Priesthood"}, {11, "Scouting"}, {31, "SpanWard"}, {20, "Stake"}, {19, "Standard Works"}, {6, "Suppliers"}, {7, "Travel"}, {13, "Vacations"}, {22, "Veterinary"}, {8, "Work"}}

Once you have the category id number, this script will return a list of every event within a certain category and that has the word ‘meeting’ in it’s title:

tell application "Palm Desktop"
	set myCat to (category id 11)
	set myEvents to every event whose primary category is myCat and title contains "meeting"
end tell

-->{event id 1669 of application "Palm Desktop", event id 1726 of application "Palm Desktop", event id 1855 of application "Palm Desktop", event id 1895 of application "Palm Desktop", event id 1982 of application "Palm Desktop", event id 2153 of application "Palm Desktop", event id 2359 of application "Palm Desktop", event id 65767 of application "Palm Desktop", event id 65772 of application "Palm Desktop", event id 65773 of application "Palm Desktop", event id 65776 of application "Palm Desktop"}

As you can see, the event list is returned as a list of reference numbers to each event that meets the searched for criteria. Once you know which properties of each event you want to extract, you just tell the script to put that data into another list. For instance, if all you wanted was the date and title of each event, you might try this:

set myEventData to {}
tell application "Palm Desktop"
	set myCat to (category id 11)
	set myEvents to every event whose primary category is myCat and title contains "meeting"
	repeat with ae in myEvents
		set end of myEventData to {ae's title, (ae's start time)}
	end repeat
end tell
myEventData
-->{{"Commissioner meeting - Spanaway Library", date "Thursday, January 15, 2004 7:00:00 PM"}, {"Commisioner meeting", date "Saturday, March 6, 2004 8:30:00 AM"}, {"Contact bishoprics for Commissioner meeting & Venture Roundtable Commissioner", date "Sunday, May 30, 2004 7:30:00 PM"}, etc., etc.}

I hope this helps you get started.

Craig,

This is an awesome start! Thank you so much. I’m like a little kid with a new toy. I can’t wait to start testing and seeing what the scripts will spit out.

Thanks again! :smiley:

Vu

You are very welcome. It is exciting to play with all this and actually do something semi-useful! Be sure to stop back if you are having any problems or need clarification about anything.

Craig,
This works except for recurring events. Is there anyway to access those and add them to your category list?

Todd Reid

Todd:

I have been working on that for over a year, with no success. The Palm Desktop dictionary states:

event occurrence‚n [inh. event > entry > item] : An occurrence of a recurring event on a particular date
elements
contains attachments; contained by events.
properties
event (reference, r/o) : the event of which this is an occurrence

So, in my thinking, this should work:

tell application "Palm Desktop"
	get every event occurrence of event 65537
end tell

(I got the number by grabbing an event that had some repeats associated with it.)

Unfortunately, that results in this error:

Palm Desktop got an error: Can’t get every event occurrence of event 65537.

I have tried all sorts of ways to use this term to get the repeats, but cannot figure it out.

Grrr…&!)#*! Palm…their Applescript support is SO abysmal!!!

I’ll keep looking at this one too and let you know what I come up with.

Best,
Todd

Yeah, I tried the following:

tell application "Palm Desktop"
	set myEvents to properties of events whose start time > preDate and start time < postDate and event occurrence > 1 and title contains "gig"
end tell

and all I get is an error “Palm Desktop got an error: Can’t relate objects.”

Grr…Grrr…

Todd

Todd:

Yeah, frustrating, isn’t it? I admit that I love my Palm Pilot, but wish they would either update the Mac Palm Desktop, or make it totally integrated with iCal. Actually, I am really just hoping that the iPhone becomes a hit and morphs into a handheld Mac…

I don’t have a Palm, but if it’s capable of syncing with iCal, then its compliant with RFC 2445, the iCalendar standard. If so, then only one instance of recurrent events is stored on the date of its creation, and all subsequent appearances are calculated “on the fly” each time you open a calendar. The particulars of a set of repeating events are stored in the recurrence property of the original event as a semicolon-delimited string (can you tell I’m in the middle of an article on recalculating iCal recurrences in AppleScript for external use?). Since that is the case, recovering recurrent events requires that you examine all events to see if the recurrence property string length is greater than zero and then calculating the recurrence you want with some date arithmetic. Let me know if my original surmise of compatibility was correct and I’ll help further.

Edit: Here is a pdf exerpt of the RecurrenceRules

It may very well be comliant, Adam, but those data do not seem accessible via AppleScript:

tell application "Palm Desktop"
	properties of event 4
end tell
-->{title:"Recur 01", start time:date "Monday, October 1, 2007 9:00:00 PM", end time:date "Monday, October 1, 2007 10:00:00 PM", duration:3600, all day event:false, alarm:missing value, primary category:missing value, secondary category:missing value, private:false, name:"Recur 01 (Oct 1)", class:event, id:65537}

The User Data file is also unreadable (probably some sort of encryption), which really leaves no way to examine the data in its raw form.

At least not that I have discovered so far…

Well, my only course of action at this point is to manually enter these appointments instead of relying on the repeat option in Palm Desktop.

An iPhone is looking VERY attractive right now…

Todd

If that’s the case, Craig, then synchronizing a Palm with iCal (assuming that’s possible) or with a Google Calendar (if that is) must require additional software (in essence a driver to decode the entry data block) on the Mac. That leaves the only way to do it is to create a calendar in iCal, called “Palm” perhaps, syncing to it, and then reading the recurrence from there. Or even more cumbersome, uploading to a google calendar (if that’s possible) and syncing that with iCal. There is a recurrence property of an event in iCal that conforms to iCalendar’s standard.

Exactly what I was thinking, Adam. There is a nifty little app called the Missing Sync for $40, which will do the whole Palm quickly and cleanly. I am pretty sure that there is a native method in OS X; but it has been months since I looked into it. I did do a sync on my Intel iMac a year ago (I don’t remember how), and the iCal reminders keep popping up on that machine, so yes, the repeat data is readable by iCal.

I might check that out this week sometime.

Do I detect a MacScripter.net Tutorial Topic? :lol:

Would be a nice follow-up to the one I’m working on about decoding iCal recurrences in AppleScript

Hmmmmmm. THAT is worth considering…

I am also keeping all my notes on beta testing Jed Green’s Chronicle for XCode. I told him I would do a review when he was ready to hit the streets with it.