Re: myLoop: getting subject of messages in Mail.app
Re: myLoop: getting subject of messages in Mail.app
- Subject: Re: myLoop: getting subject of messages in Mail.app
- From: cricket <email@hidden>
- Date: Mon, 3 Mar 2003 15:37:21 -0800
On Monday, March 3, 2003, at 3:24 PM, Bill Briggs wrote:
You need to evaluate 'all messages of front message viewer' first
before you can start iterating through it as a list. Putting a 'get'
in front of it causes that evaluation to happen. Before being
evaluated, think of 'all messages of front message viewer' as being a
reference to one thing that has not yet been evaluated, rather than a
list of already evaluated message objects.
By that line of argument the behaviour of "Scriptable Text Editor",
which still stands as a model of good AppleScript implementation, is
wrong. Witness.
tell application "Scriptable Text Editor"
make new document -- no location reference necessary, nor should it be
set pRef to (make new paragraph at end of document 1) -- location
reference makes sense here
set text of pRef to "I am the text!"
text of pRef -- returns correct text
text of last paragraph of document 1 -- returns correct text
last character of document 1 -- returns expected character
third character of last paragraph of document 1 -- returns expected
char
end tell
You're right given your examples here, but the original poster had a
repeat loop which assigned a variable to an unevaluated expression,
which, when evaluated, returns a list.
There are cases where a get is absolutely required if you want to
accomplish something in a single Applescript statement.
- cricket
----->
Software Entomologist Mail for Mac OS X
http://www.apple.com/macosx/jaguar/mail.html
---------->
Mantis green and strong, deadly pincers razor sharp, waiting for his
chance.
_______________________________________________
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.