Re: Scripting Palm Desktop
Re: Scripting Palm Desktop
- Subject: Re: Scripting Palm Desktop
- From: Chris Page <email@hidden>
- Date: Tue, 9 Apr 2002 22:35:36 -0700
[This is in reply to private mail, but I thought my reply might be
of interest to the list.]
On Tuesday, April 9, 2002, at 09:03 , John McAdams wrote:
The above code tries to figure out what kind of note is attached
to an event. "attachment" currently returns a list which needs to
be coerced and then I can look at the first item. It would be more
efficient to be able to get the type of attachment ala: if type of
the attachment is memo...etc.
I think you need support for the "class" property so you can write
"class of attachment 1".
One thing I should clarify is that when you get an object, Palm
Desktop returns a record instead of an object reference:
memo 1
--> {object class:+class NOTE;, object number:0, object
instance:-1}
This record contains internal information used to describe the
object inside the app. The "object class" property of this record
is really an enumeration value and not the same as the AppleScript
class. [It's a bug that it is marked as a class instead of an
enumeration. The enumerations are defined in the terminology, but
the app sets the type of the property value to typeType instead of
typeEnumerated, so you don't see the enumeration name as you
should.] This record is really an object id, and "get memo 1"
should really return:
--> memo id {...}
Or perhaps even better:
--> memo 1
Anyway, this means that you currently have to know what the
AppleScript class is in order to get properties of an object. You
have to write:
set x to memo 1 -- assigns an id record to x
get body of memo id x
Whereas you'd like to be able to write:
set x to memo 1
get body of x -- doesn't currently work because x isn't an
object specifier
[You can also currently write just "memo x" because Palm Desktop
automatically realizes you're providing an id record, but the
strictly correct form is "memo id x".]
Perhaps the most important point here is that the id record is
really internal information that you shouldn't have to interpret
and shouldn't attempt to manipulate. I consider it a bug that you
are required to do so currently.
--
Chris Page - Mac OS Lead, Palm Desktop - Palm, Inc.
_______________________________________________
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.