|
|||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
#1 |
|
Prospect
Join Date: Jul 2009
Posts: 4
|
Applescript to create new remote mailbox on IMAP server in Mail.app
Hi!
I'm endeavoring to create an Applescript that can create a new, nested mailbox (aka "folder") on the remote MobileMe server. So far, this is what I have: Code:
set parent_mailbox to "Happy"
set child_mail_box to "GoLucky"
tell application "Mail"
-- Check to see if this mailbox does not exist.
if not (exists mailbox (parent_mailbox & "/" & child_mail_box) of account "MobileMe") then
--trying to create the new mailbox
make new mailbox with properties {name:parent_mailbox & "/" & child_mail_box} of account "MobileMe"
end if
end tell
1) On the MobileMe IMAP mailbox list, check to see if the mailbox "GoLucky" already exists under the currently-existing mailbox called "Happy" 2) If it does exist, exit. 3) If it does not exist, create a new mailbox and name it "GoLucky" under the currently-existing remote mailbox named "Happy" I can get Applescript to create a new, non-nested, LOCAL mailbox, but I'd like to create a new, nested mailbox on the REMOTE server. Any ideas? |
|
|
|
|
|
#2 |
|
Prospect
Join Date: Jul 2009
Posts: 4
|
I figured it out...
Code:
set parentMailbox to "Happy"
set childMailbox to "GoLucky"
tell application "Mail"
tell account "MobileMe"
if not (exists mailbox (parentMailbox & "/" & childMailbox)) then
set mbox to make new mailbox with properties {name:parentMailbox & "/" & childMailbox}
end if
end tell
end tell
|
|
|
|
|
|
#3 |
|
MVP
Join Date: Dec 2009
Location: Pembroke, Ontario
Posts: 2,051
|
Good job FF!
|
|
|
|
![]() |
| Tags |
| applescript, imap, mail.app, mailbox, nested |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|