Re: Palm Desktop 4.1 (creating a memo)
Re: Palm Desktop 4.1 (creating a memo)
- Subject: Re: Palm Desktop 4.1 (creating a memo)
- From: Chris Page <email@hidden>
- Date: Wed, 30 Apr 2003 19:11:58 -0700
On Wednesday, Apr 30, 2003, at 07:20 US/Pacific, Brennan wrote:
Chris, I'm seeing problems whe I try to set the contents of a memo.
tell application "Palm Desktop"
tell (make memo)
set title to "test"
set contents to "this is cool" -- error here
end tell
end tell
A little consultation over on the applescript-implementers list
revealed that this is a little confusing, but not a bug. You need to
change your script to:
set contents of contents to "this is cool"
When you use the result of 'make memo', you're working with a reference
to the memo. When you ask for the contents of a reference, you get the
object it refers to. So your version of the script means:
set memo id 42 to "this is cool"
Adding another 'contents of' changes this to:
set contents of memo id 42 to "this is cool"
You'll see the same behavior if you assign the reference to the memo to
a variable:
set m to make memo
set contents of m to "this is cool" -- error here
set contents of contents of m to "this is coo" -- works
It seems AppleScript automatically gets the contents of the reference
when you ask for some property other than 'contents'.
I thought using the generic 'contents' property would simplify things,
but it seems that this creates a potentially confusing experience,
since it's different from other properties.
--
Chris Page - Software Wrangler - 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.