does anybody know how to create a mailbox within a custom folder in Mail.app?
The only solution I found is GUI scripting
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
set Customfolder to "foo"
set subfolder to "bar"
tell application "Mail"
make new mailbox with properties {name:(Customfolder & "/" & subfolder)}
end tell
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.