Re: Mail Script to remove AUGD from Subject
Re: Mail Script to remove AUGD from Subject
- Subject: Re: Mail Script to remove AUGD from Subject
- From: "Mark J. Reed" <email@hidden>
- Date: Sat, 10 Jan 2009 22:48:45 -0500
I would not expect a script written for Microsoft Entourage to work in
Apple Mail, no. Different applications have different dictionaries;
the vocabulary that works within an application "tell" block is pretty
much entirely up to that application, with only the basic syntax
determined by Applescript itself. In this case I don't think the
top-level application object for Mail has a concept of "messages" -
you have to drill down further to get to that point. Look at its
dictionary to find the details.
On Sat, Jan 10, 2009 at 10:45 PM, Geoff WALLACE <email@hidden> wrote:
> Hello All,
>
> Barry Wainwright provided this script for Ent 2008.
>
> "tell application "Microsoft Entourage"
> set currentMessages to the current messages
> repeat with theMsg in the currentMessages
> set str to the subject of theMsg
> if str begins with "AUGD:" then
> set str to text 6 thru -1 of str
> try
> repeat until first character of str is not " "
> set str to text 2 thru -1 of str
> end repeat
> on error
> -- str is empty
> set str to "<No Subject"
> end try
> set subject of theMsg to str
> end if
> end repeat
> end tell"
>
> Wanted to try it in the Apple Mail Program on OS X 10.5.6.
>
> Simple, change "Microsoft Entourage" to "Mail" in the 2nd line, I thought?
>
> On doing this and trying to get the script to compile, get an error message
> as follows
> "Syntax Error
> Expected end of line but found plural class name."
>
> Is the syntax required for the Apple Mail program different to that required
> for the Apple Mail Program?
>
> --
> Do you own or use an Apple Macintosh Computer?
> If so at some time you will need the macfixer
> <http://macfixer.com.au> Mob: 0412 056 033 Ph: 61 3 9893 1677
> Geoff WALLACE
>
>
>
>
> _______________________________________________
> 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
>
--
Mark J. Reed <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