What’s Wrong With AppleScript
May 18th, 2005
| Tags: macintosh
This simple script gives away one of the major problems with 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 tellset subject of theMsg to "Hello"
set theSubject to subject of theMsg
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 tellset theContent to content of theMsg
set content of theMsg to theContent
If you have any suggestions, please feel free to post a comment.
Leave a comment