• 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: Scripting Mail:get selection
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Scripting Mail:get selection


  • Subject: Re: Scripting Mail:get selection
  • From: cricket <email@hidden>
  • Date: Mon, 24 Feb 2003 13:11:53 -0800

You're doing a disservice to would-be scripters by letting your attitude get in the way of helping users with real issues.

There are some holes in our applescript functionality, but it's not a totally bizarre or useless dictionary by any stretch of the imagination. Anyone that takes a look at the dictionaries and compares them to other email clients (I have them all pinned to my bulletin board) will quickly realize this. Discouraging them with your hyperbole doesn't help anyone and it's also not very interesting to read. There are some things you can't do in Mail scripting, but there are a lot of things you can do that other clients can't do.

For those that really want to know, getting the selection is a hole in Cocoa scripting that should hopefully be filled in the next release. In the meantime, you could use System Events scripting to paste clipboard text into a selection. For example,

tell application "System Events"
tell process "Mail"
click menu item "Paste" of menu "Edit" of menu bar 1
end tell
end tell

Note: This works in 10.2.3 and later and you have to enable access for assistive devices in Universal Access prefs.

- cricket

On Monday, February 24, 2003, at 12:41PM, John Delacour wrote:

A simple and basic question about scripting Mail under Mach-O 10.2:

How to copy-paste to the Clipboard a user selection in any Mail's displayed (frontmost) window?

-- set userSelection to window 1's selection
-- set the clipboard to userSelection

But, 'selection' is not a Mail's keyword, nor 'content':

-- get window 1's content -- doesn't work

Both 'selection' and 'content' are understood by Mail, but not as we understand them. Remember Mail is spawned on planet Unix.

If you have a message selected in a message summary, you can get the text of the message like this:

tell app "Mail" to get the content of item 1 of (get selection)

which must be an obvious way to do it in that corner of the universe. As to making any sense of Mail or putting its vast and totally bizarre dictionary to any practical use, take Paul's advice -- or mine ... forget it! The only good thing about Mail is that it recognises junk. It takes some to know some.
_______________________________________________
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: Scripting Mail:get selection
      • From: John Delacour <email@hidden>
    • Re: Scripting Mail:get selection
      • From: Michelle Steiner <email@hidden>
References: 
 >Re: Scripting Mail:get selection (From: John Delacour <email@hidden>)

  • Prev by Date: Re: Handler works only once
  • Next by Date: Scripting iPhoto
  • Previous by thread: Re: Scripting Mail:get selection
  • Next by thread: Re: Scripting Mail:get selection
  • Index(es):
    • Date
    • Thread