create a mailbox within a custom folder in Mail.app

Hi,

does anybody know how to create a mailbox within a custom folder in Mail.app?
The only solution I found is GUI scripting :confused:

It seems, that Apple enhances the features of their programs but doesn’t adjust the AppleScript dictionary.
iPhoto 08 has magnificent improvements, but the dictionary hasn’t changed at all e.g you can’t access an event with AppleScript

No, i couln’t even move another mailbox into another.

here you go… I hope thats what your looking for


set Customfolder to "foo"
set subfolder to "bar"
tell application "Mail"
	make new mailbox with properties {name:(Customfolder & "/" & subfolder)}
end tell

mm

Stefan,

Mail is notorious for having a messed up dictionary. When Tiger came out the “signatures” functionality got totally hosed.

McGrailM’s code should work for you in this instance, though. But Mail also doesn’t report Applescript errors if something is wrong - scripts just silently die without telling you why. Put your code in a try.on error block and have errors reported in a dialog box of your own making and you can get around this, though.

Thank you very much.
I didn’t hit on just concatenating the “paths” :wink:

Thanks Kevin, too :slight_smile:

Stefan,

Your welcome. You know I don’t know what it was that made me think to do that but it works !

mm