• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: myLoop: getting subject of messages in Mail.app
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.
  • Follow-Ups:
    • Re: myLoop: getting subject of messages in Mail.app
      • From: Bill Briggs <email@hidden>
References: 
 >Re: myLoop: getting subject of messages in Mail.app (From: Bill Briggs <email@hidden>)

  • Prev by Date: Re: Cocoa Loco
  • Next by Date: Re: myLoop: getting subject of messages in Mail.app
  • Previous by thread: Re: myLoop: getting subject of messages in Mail.app
  • Next by thread: Re: myLoop: getting subject of messages in Mail.app
  • Index(es):
    • Date
    • Thread