• 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: Running an Applescript in Mail
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Running an Applescript in Mail


  • Subject: Re: Running an Applescript in Mail
  • From: Christopher Stone <email@hidden>
  • Date: Tue, 7 Nov 2017 19:41:39 -0600

Hey John,

Someone asked me off-list why I used this form when the reference to the app is
not strictly necessary.

-----------------------------------------------------------

tell application "Mail"
    set mailboxReference to mailbox "ACTION" of application "Mail"

    tell (some message viewer whose index is 1)
        set selected mailboxes to {mailboxReference}
    end tell

end tell

-----------------------------------------------------------

This is because it will fail if written like this (without the reference to the
app):

-----------------------------------------------------------

tell application "Mail"

    tell (some message viewer whose index is 1)
        set selected mailboxes to mailbox "ACTION"
    end tell

end tell

-----------------------------------------------------------

So by habit I just leave in the whole reference whenever I use mailbox
references.

--
Take Care,
Chris

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

References: 
 >Running an Applescript in Mail (From: John Mitchell <email@hidden>)

  • Prev by Date: Re: Reading "AppleScript, the definitive guide"
  • Next by Date: Re: Reading "AppleScript, the definitive guide"
  • Previous by thread: Running an Applescript in Mail
  • Next by thread: Re: What is Best Method To Determine Duplicate Items in a Large List?
  • Index(es):
    • Date
    • Thread