• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Record id of an item in Palm Desktop
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Record id of an item in Palm Desktop


  • Subject: Re: Record id of an item in Palm Desktop
  • From: Chris Page <email@hidden>
  • Date: Thu, 11 Apr 2002 12:07:27 -0700

On Wednesday, April 10, 2002, at 11:17 , lee hinde wrote:

tell application "Palm Desktop"
activate
set memoid to make new memo with data {body:"some text", title:"new title"}
set todoid to make new to do with data {title:"test", reminder:1}
attach memo of memoid to to do of todoid
end tell

And I get an error at the last line. I've also tried:

attach memo id of memoid to to do id of todoid

What is the proper syntax?

"make new" returns an id, not a reference (I consider this a bug). So you have to refer to the new objects using the "id" form:

attach memo id memoid to to do id todoid

As it happens, I just wrote about this recently on the "Scripting Palm Desktop" thread:

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".]


--
Chris Page - Spoon Bender, Palm Desktop - Palm, Inc.

There is no spoon.
But the fork mocks me by clinging tenaciously to its limited concept of reality.
_______________________________________________
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.
References: 
 >Record id of an item in Palm Desktop (From: lee hinde <email@hidden>)

  • Prev by Date: Re: Trimming down a list
  • Next by Date: Re: Record id of an item in Palm Desktop
  • Previous by thread: Record id of an item in Palm Desktop
  • Next by thread: Re: Record id of an item in Palm Desktop
  • Index(es):
    • Date
    • Thread