Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Scripting Mail.app



Hi,

The following script selects the english dictionary from the "Spelling" window:

tell application "Mail" to activate
tell application "System Events"
keystroke ";" using {shift down, command down}
tell pop up button 1 of group 1 of window "Spelling" of process "Mail"
click
click menu item 5 of menu 1
end tell
end tell

Though, I would like to close the "Spelling" window after the process using:

tell application "Mail"
close window "Spelling"
end tell

but this produces the following error: Mail got an error: NSReceiverEvaluationScriptError: 4

It's working with other windows inside Mail.app, but the "Spelling" window seems to be of a different kind, though "UI Element Inspector" doesn't say anything special about this window. What would be the appropriate command to close the "Spelling" window?

Also, while my script is running from within the Script Editor and when called from the script menu of the system, it doesn't work if called from Mail.app's script menu. Do I need to do anything beside copying the script to the appropriate folder in ~/Library?

Thanks for your help,
Simon
_______________________________________________
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.



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.