0

I am trying to access folder in my mail using apple script. but did not succeed.

My folder Name is : BLABLABLA , it resides under Apple Mail .

I think that it should be :

set myDir to mailbox "BLABLABLA"

this does not work, any suggestions ?

1 Answers1

0

This will retrieve the account mailbox

tell application "Mail"
    set AccountNames to name of accounts
    choose from list AccountNames with prompt "Select the email account" ¬
    without multiple selections allowed
    set AccountName to result as string
    set MailboxesListV to mailboxes of account AccountName
end tell

Which is what I think you want. (Notice that the result is a list.)

I hope it helps.

MBUST
  • 76
  • 7
  • the account name is not existed , in the given format. and it makes sense. I have tried using my real account instead, unfortunately did not worked also – Jehad Ghanayem May 08 '18 at 09:33
  • Ok, perhaps you don't have the name of the account as precise as the script needs it? I'm editing the script above to extract the account name, it will then ask you to choose the name, and pass it to a variable that then creates a list of all the mailboxes in the selected account. – MBUST May 09 '18 at 09:54
  • Hi , The result is list of all Directories , and that great. Thanks, Now in order to iterate over this mailbox , how could I get it as object ? – Jehad Ghanayem May 09 '18 at 11:13
  • That is a different question from the original. I'm happy to help you, but ask a new question and try to explain a little. – MBUST May 10 '18 at 08:18