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 20:10:39 -0400
At 4:02 PM -0800 03/03/03, cricket wrote:
On Monday, March 3, 2003, at 3:48 PM, Bill Briggs wrote:
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.
The simplest example I know of is this:
tell app "Microsoft Entourage"
say subject of message 1 of folder 1
end tell
That script fails (presuming folder 1 has 1 message in it).
However, this works:
tell app "Microsoft Entourage"
say (get subject of message 1 of folder 1)
end tell
The 'say' command expects a string, not an object reference, so it
fails unless you evaluate it first. This also works (which is the
workaround the original poster stumbled upon):
tell app "Microsoft Entourage"
set theSubject to subject of message 1 of folder 1
say theSubject
end tell
The set command does an implicit get on the expression, and sets it
to a string instead of an object.
Personally, I think the first example should just work, but it doesn't.
I agree, it should work. I don't have Entourage so can't test it,
but if you bracket it like this
tell app "Microsoft Entourage"
say (subject of message 1 of folder 1)
end tell
does it evaluate or not? Sometimes the parser that gets confused with
some constructs unless you enclose the reference in parens. See if it
works. I can't check it in that application.
- 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.