What’s Wrong With AppleScript

May 18th, 2005 | Tags:

This simple script gives away one of the major problems with [AppleScript](http://www.apple.com/applescript/): sometimes it just doesn’t work. This script gives no errors, but does not set the subject of the message:


tell application "Mail"

set theMsg to item 1 of (the selection as list)
set subject of theMsg to "Hello"
set theSubject to subject of theMsg

end tell


While this script returns a helpful `NSInternalScriptError` from Mail:


tell application "Mail"

set theMsg to item 1 of (the selection as list)
set theContent to content of theMsg
set content of theMsg to theContent

end tell

If you have any suggestions, please feel free to post a comment.

No comments yet.
You must be logged in to post a comment.