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: Bill Briggs <email@hidden>
- Date: Mon, 3 Mar 2003 19:48:46 -0400
At 3:37 PM -0800 03/03/03, cricket wrote:
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.
The repeat loop is irrelevant. The line was
set allMsg to all messages of front message viewer
but I fail to see how evaluating this is any different from evaluating this
characters 1 through 6 of last paragraph of document 1
which in my Scriptable Text Editor exampl returns a list as well. The
fact that it's a list is also irrelevant. Both of these are nothing
more or less complicated than references to objects. Again, I assert
that there's no reason for one to write such a thing in a script if
the intent was not to have it evaluated. Convince me otherwise. No
quibbles please.
There are cases where a get is absolutely required if you want to
accomplish something in a single Applescript statement.
In this case it's required because the scripting implementation
isn't according to Hoyle. Which is what JD is trying to convince you
of.
- web
_______________________________________________
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.