• 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: Mail.app selection of front window
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Mail.app selection of front window


  • Subject: Re: Mail.app selection of front window
  • From: Paul Skinner <email@hidden>
  • Date: Fri, 28 Mar 2003 18:03:17 -0500

On Friday, March 28, 2003, at 04:58 PM, Matthew Galaher wrote:

I installed the UI Scripting beta software, and so Cricket's bit of code compiles without error, but when I run the following:
--
try
tell application "System Events"
tell application process "Mail"
click menu item "Copy" of menu "Edit" of menu bar 1
end tell
end tell
on error the_error
display dialog the_error buttons {"Cancel", "OK"} default button 2
end try
--

It returns "NSReceiverEvaluationScriptError: 4"

Any thoughts?

I don't know for sure, but did you choose the 'Enable access for assistive devices' checkbox in the Universal Access control panel? You need to.

It probably still won't work, but you'll get a different result. I get the entire contents of the message that contains my selected text. That's because when Mail goes into the background the current selection becomes greyed-out. That means if you pop back in there and do a copy, even manually, the selection isn't the 'Active' selection. The top-most ( or first or whatever ) selection is the mail message that you had selected to display and that is what gets copied. If you open the message into it's own window by double clicking it, then run your script, you get the selection that you have made in the document.

Paul Skinner
_______________________________________________
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.

References: 
 >Re: Mail.app selection of front window (From: Matthew Galaher <email@hidden>)

  • Prev by Date: Re: Test for undefined variable?
  • Next by Date: Re: Safari AutoFill
  • Previous by thread: Re: Mail.app selection of front window
  • Next by thread: Re: Mail.app selection of front window
  • Index(es):
    • Date
    • Thread