• 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: Applescript and Mail
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Applescript and Mail (From: Matteo Lovatti <email@hidden>)

  • Prev by Date: Re: Mail.app - dictionary implementation questions.
  • Next by Date: printing via applescript
  • Previous by thread: Applescript and Mail
  • Next by thread: printing via applescript
  • Index(es):
    • Date
    • Thread