Re: Applescript and Mail
Re: Applescript and Mail
- Subject: Re: Applescript and Mail
- From: John Delacour <email@hidden>
- Date: Tue, 2 Sep 2003 10:10:09 +0100
- Mac-eudora-version: 6.1a1
At 9:24 am +0200 2/9/03, Matteo Lovatti wrote:
Hi everybody! My name's Matteo from Italy and
i'm new to the list. I've just started writing
my first scripts but
i'm already hang in this problem. I want to
write a Mail script that reads the content in
the message subject line and assign the last
word of it to a variable. Since now i wrote this
two lines
tell application "Mail"
set password to (last word in message subject) as text
end tell
but when running it i get the error
"NSCannotCreateScriptCommandError" on the word
subject.
1. You should not use words like password as
variable names. I suggest that as a rule you use
an underline at as the first character of all
variables.
2. 'message subject' means nothing; You must
first get a reference to the message you are
referring to and then get the 'subject' of this.
tell application "Mail"
set _message to item 1 of (get selection)
set _password to last word of (get subject of _message)
end tell
JD
.
_______________________________________________
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.