On or near 12/5/00 1:54 PM, John M Young at [EMAIL PROTECTED] observed:

> Sorry to ask a question that should be easy ... But I really don't know
> apple script. I have tried to figure this out with no success. I have two
> scripts both posted here that I can't get to work.
> 
> The first is:
> 
> set theCategories to category of theMsg
>   set newCategories to {}
>   repeat with aCategory in theCategories
>       if aCategory � category "Junk" then set end of newCategories to
> aCategory
>   end repeat
>   set category of theMsg to newCategories
> 
> When I check Syntax I get ... Expected "then", etc. but found ".
> 
"category" is something known only to Microsoft Entourage, so the script
line needs to be addressed to that application, by enclosing your script in
a "tell block," like this:

tell application "Microsoft Entourage"
set theCategories to category of theMsg
  set newCategories to {}
  repeat with aCategory in theCategories
      if aCategory � category "Junk" then set end of newCategories to
aCategory
  end repeat
  set category of theMsg to newCategories
end tell

As it stands the script still will not work because "theMsg" is not defined.
This was originally posted as a snippet to be added to another script.

> The Second is:
> 
> tell application "Microsoft Entourage" --
>   set currentMessages to the current messages --
>   repeat with theMsg in the currentMessages --
>       my ProcessMsg(theMsg) --
>   end repeat --
> end tell --
> 
> on ProcessMsg(theMsg) --
>   tell application "Microsoft Entourage" --
>       set temp to the category of theMsg --
>       -- Remove the "junk" category--
>       set newCat to {} --
>       repeat with aCat in temp --
>           if aCat � category "Junk" then set end of newCat to aCat --
>       end repeat --
>       copy category "MF Extras/Other" to end of newCat --
>       (* Or, if you want that to be the first category that shows,--
> use this version of setting the category list: --
>       set temp to {category "MF Extras/Other"} & temp
> *)
>       set the category of theMsg to newCat --
>       move theMsg to folder "Sub-subfolder 2" of folder "Subfolder 1" of
> folder "Inbox" --
>   end tell --
> end ProcessMsg --
> 
> This one will compile but when I run it I get ... Microsoft Entourage got an
> error: Can't get category "MF Extras/others".
> 
You evidently don't have a category of that name defined in your copy of the
program. Change it to a category you <do> have, probably something like
"Business".
> --
> To unsubscribe:               <mailto:[EMAIL PROTECTED]>
> To search the archives:
>         <http://www.mail-archive.com/entourage-talk%40lists.boingo.com/>

-- 
Peace,
Allen Watson <[EMAIL PROTECTED]> XNS name: =Allen Watson
A Mac family since 1984 <http://home.earthlink.net/~allenwatson/>
Applescripts for Outlook Express and Entourage:
<http://homepage.mac.com/allenwatson/>


--
To unsubscribe:               <mailto:[EMAIL PROTECTED]>
To search the archives:
          <http://www.mail-archive.com/entourage-talk%40lists.boingo.com/>

Reply via email to