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 16:02:01 -0800
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.
- cricket
----->
Software Entomologist Mail for Mac OS X
http://www.apple.com/macosx/jaguar/mail.html
---------->
Smell the burning flesh; taste the tangy sulphur air; volcano season.
_______________________________________________
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.