Adding Category to messages using AppleScript

set category of aMessage to {category "PRH", category "PMH"}

Above line adds two Categories to a selected message but what if the message already has a Category and I want to ADD these two to it rather than REPLACING as it currently does?

I did think of using the line below but was unable to convert the ID of the Category to its Name

set idCat to category of aMessage


Answer
Answer

This may work for you:

tell application "Microsoft Outlook"

set theMessages to selection

repeat with aMessage in theMessages

set theList to categories of aMessage

set end of theList to category "Team"

set category of aMessage to theList

end repeat

end tell

Hope this helps!

William M. Smith
http://talkingmoose.net
http://twitter.com/meck

5 people found this reply helpful

·

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

 
 

Question Info


Last updated October 25, 2023 Views 741 Applies to: