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 03:25:32 -0700
On Tuesday, Apr 29, 2003, at 22:23 US/Pacific, Adrian Smith wrote:
I haven't tried any of the new features in the scripting support but
it does seem to have broken some scripts I have come to rely on...
Yes, the changes I made will break some compiled scripts and some text
scripts.
The following doesn't apply to your situation, but as a general
comment: Be sure to read the terminology dictionary. I tried to add
adequate documentation for each term, and for terms that have been
obsoleted the comment should indicate how to update your script.
tell application "Palm Desktop"
make memo
set title of memo 0 to "Handheld Note: To Do Item"
end tell
This is a little subtle. Index zero is a hack to give you access to the
memo (or address) currently displayed in the detail window. If the
detail window isn't visible, you can't rely on index zero being valid.
This special behavior is primarily there so that scripts attached to
custom address field buttons can refer to the address displayed when
the button was clicked to run the script.
A new alternative is to use the 'selection' property, which will return
the list of selected items in the front window. For detail windows the
selection will be the item displayed in the window.
But wait! There's more! It used to be that when you created a memo or
address, the detail window would be shown, just as if the user had
created the item by selecting the appropriate command in the
application. I removed this behavior for several reasons: It made
scripts slower, it was visually distracting, and the scripting support
is meant to manipulate user data objects, not the UI (unless explicitly
requested; e.g., you can set the position of a window).
So, your script relies on 'make memo' opening the memo detail window so
that you can set the title of 'memo 0', and that is no longer
happening. The best way to rewrite your script is to just indicate the
desired title when creating the memo:
make memo with properties {title:"Handheld Note: To Do Item"}
Or, for something closer to your script, you could use the result of
'make memo':
make memo
set the title of the result to "Handheld Note: To Do Item"
This didn't used to work as-is in previous versions, because Palm
Desktop returned "object records" instead of references. Now it behaves
in the expected way, and "object records" have been removed altogether.
'make memo', for example, might now return:
-> memo id 42
--
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.