Pages

Monday, April 15, 2013

AppleScript failing on getting mailbox

I'm working on an Automator action to find all messages in a particular Mail folder (named ". Do"), create Reminders for each, and then move the messages from the ". Do" folder to a separate folder (named ". Do Later")

 

The first portion is working fine. That is, using Automator, I can find the relevant messages by using the Get Specified Mail Items action linked to a Filter Mail Messages action. The Get Specified Mail Items looks at . These two actions work fine. I see all relevant messages in the Automator results window for my Filter Mail Messages action.

 

I then launch an applescript to process the found messages, move them to Reminders and then move the messages from the ". Do" folder to my suspense folder (". Do Later"). The first part of the script works fine. The messages are found and new Reminders are created with all of the meta data I've created. However, I can't get the last step to work to move the messages to a new folder.

 

The script continues to abort with the error "Can't get mailbox ". Do Later" of account "Exchange". See below for the relevant portion of the script. I'm an AppleScript novice (clearly!). It seems i'm not forming the correct reference to the ". Do Later" folder. I can't figure out how to troubleshoot any further to either debug the script failure or to inspect the Mail folder structure to insure I'm usring the right reference.

 

Any tips?  thanks -- jay

 

# theMessage contains current message being processed

 

# Move message out of . Do

                              set theMoveToMailbox to ". Do Later"

                              tell application "Mail"

                                        move the theMessage to mailbox theMoveToMailbox of account "Exchange"

                              end tell

 

 

Mountain Lion

 

Message was edited by: jayelevy


View the original article here

0 comments:

Post a Comment