• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Problem creating new mailbox
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem creating new mailbox


  • Subject: Re: Problem creating new mailbox
  • From: Philip Aker <email@hidden>
  • Date: Mon, 8 Jun 2009 04:47:19 -0700

On 2009-06-08, at 03:40:51, Mark Lawrence wrote:

2. tell application "Mail" to make new mailbox with properties {name:"articles/print/journals"}


#2 works for me on 10.5.7.

Works fine for me on 10.5.6 but not what I want. To repeat my original request and add some extra bits.

I don't think I can comment any further because I can't emulate your setup (pop accounts can only create new mailboxes locally).
On my setup, asking Mail to create a new mailbox in a 'tell account "xxx"' block errors.
But if you can do it manually, there's some chance you could use UI scripting to achieve the goal.



I'm trying to automate the create of mailboxes and am failing dismally. The first piece of code shows that I can access the target mailbox and retrieve the contents.
tell application "Mail"
set supplierMailbox to mailbox "Suppliers" of mailbox "futuremedia" of account "shared"
set supplierMailbox to mailboxes in supplierMailbox
end tell
The response to this is a list the first entry being mailbox "user/ futuremedia/Suppliers/2xstream" of account "shared" of application "Mail"


The next piece of code gives AppleScript Error Mail got an error: AppleEvent handler failed.
tell application "Mail"
set supplierMailbox to mailbox "Suppliers" of mailbox "futuremedia" of account "shared"
make new mailbox in supplierMailbox with properties {name:"test"}
end tell
Here's the console output which hopefully helps.
08/06/2009 11:05:45 Mail[1128] replaceInMailboxes:atIndex: called with value: <MailboxUid:0x175baab0 (relative path=, attributes=0x0)>
08/06/2009 11:05:45 Mail[1128] An exception was thrown during execution of an NSScriptCommand...
08/06/2009 11:05:45 Mail[1128] Can't replace value in mailboxes at index 1877 with object: <MailboxUid:0x175baab0 (relative path=, attributes=0x0)>

I've checked that there isn't a mailbox called test under the target Suppliers mailbox. I can manually create and delete a test mailbox under the target no problem.


Philip Aker
echo email@hidden@nl | tr a-z@. p-za-o.@

Democracy: Two wolves and a sheep voting on lunch.

_______________________________________________
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
References: 
 >Re: Problem creating new mailbox (From: Mark Lawrence <email@hidden>)
 >Re: Problem creating new mailbox (From: Philip Aker <email@hidden>)
 >Re: Problem creating new mailbox (From: Mark Lawrence <email@hidden>)

  • Prev by Date: Re: Problem creating new mailbox
  • Next by Date: Re: Mail's Sent Messages
  • Previous by thread: Re: Problem creating new mailbox
  • Next by thread: Re: Problem creating new mailbox
  • Index(es):
    • Date
    • Thread