• 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: Looking for documentation to fill in the blanks...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Looking for documentation to fill in the blanks...


  • Subject: Re: Looking for documentation to fill in the blanks...
  • From: Malcolm Fitzgerald <email@hidden>
  • Date: Fri, 8 Feb 2008 10:42:14 +1100


On 08/02/2008, at 9:36 AM, Stephen Jones wrote:

I am new to Applescript.  I was hoping I could create a simple application which would process incoming mail to a specific mailbox and extract data from the body of the mail.  The mail messages are formatted.  This process is currently implemented in an Exchange/SQL environment but I want to move it to Mac OS X Mail and Filemaker.

I have downloaded all the Applescript documentation I can find, but I am baffled by the Script dictionary for Mail.  

I have two basic questions:

a) The dictionary provides nothing in the way of usage - there are no examples.  Where do I find documentation which explains how the dictionary parameters are actually used in a script?


Look in the Applescript folder (in Applications) for the applescript utiility. Use it add the script menu to your menus and to include the library scripts. There are a few examples for Mail in there.





b)  Return values.  The dictionary does not state what the return values are.  For instance:

check for new mail v : Triggers a check for email.
check for new mail
[for account] : Specify the account that you wish to check for mail

So I understand this will run a check for new mail - but what is the result of this?  Do I get a boolean value returned?  How do I use this in a script?


Those commands don't return any value. Try this:

tell application "Mail" to set s to check for new mail

you'll see that control is returned back to you immediately, s is empty, and Mail is busy downloading messages.




c)  Usage, general.  I created a simple script just to get started.  It does not work however - but then I am guessing as to how to do this:

set mailbox to "special"

tell application "Mail"
set NewMessages to unread count of mailbox
display dialog NewMessages
end tell


Close. Two mistakes.

1. Mailbox is an application keyword. Using "mailbox" as a variable name is going to lead to trouble.
2. You didn't specify which mailbox you wanted to work with


set mbox to "LED"

tell application "Mail"
set NewMessages to unread count of mailbox mbox
display dialog NewMessages
end tell


Malcolm Fitzgerald
email@hidden



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: Looking for documentation to fill in the blanks...
      • From: Christopher Nebel <email@hidden>
References: 
 >Looking for documentation to fill in the blanks... (From: Stephen Jones <email@hidden>)

  • Prev by Date: Looking for documentation to fill in the blanks...
  • Next by Date: Re: Getting script to run with apple mail rules.
  • Previous by thread: Looking for documentation to fill in the blanks...
  • Next by thread: Re: Looking for documentation to fill in the blanks...
  • Index(es):
    • Date
    • Thread