• 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: Script works on my machine, returns 0 results on another
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Script works on my machine, returns 0 results on another


  • Subject: Re: Script works on my machine, returns 0 results on another
  • From: "koenig.yvan" <email@hidden>
  • Date: Sun, 18 May 2014 12:50:02 +0200


Le 18/05/2014 à 12:00, Thomas Fischer <email@hidden> a écrit :

Hello Yvan,

A feature is puzzling me : when I ask Mail to return the names of every mailboxes, Gmail's ones aren't listed.
In fact no mailbox named "Sent Messages" is returned although six of them exist.

if I ask Mail to list all mailboxes, it list only the mailboxes of my standard (preferred?, first?) account.
The following script will ist all mailboxes for me.

tell application "Mail"
set myMailboxes to {}
set myAccounts to the name of every account
repeat with theAccount in myAccounts
tell account theAccount
copy theAccount & ":" to the end of myMailboxes
copy the name of every mailbox to the end of myMailboxes
end tell
end repeat
myMailboxes
end tell

Best
Thomas

Thanks Thomas

It seems that I don't understand what Mail call accounts.
I created seven accounts :
iCloud
Gmail
koenig.yvan SFR (which I use to post here)
…
Yahoo
But Mail use an other set of accounts.

1st example
tell application "Mail"
every mailbox
(*
{…mailbox "forum AppleScript shell" of application "Mail", mailbox "forum AppleScript US" of application "Mail", mailbox "forum inDesign" of application "Mail", mailbox "forums Apple" of application "Mail", …, mailbox "Seedx/Lion…" of application "Mail", mailbox "Seedx/Mavericks" of application "Mail", mailbox "Seedx" of application "Mail", mailbox "Support" of application "Mail", mailbox "zzzz" of application "Mail", mailbox "Outbox" of application "Mail", mailbox "Deleted Messages" of application "Mail", mailbox "Junk" of application "Mail"}
*)
properties of mailbox "forum AppleScript US"
--> {account:missing value, name:"forum AppleScript US", container:account "Sur mon Mac", class:container, unread count:0}
# In fact it belongs to my account koenig.yvan SFR
properties of mailbox "forums Apple"
--> {account:missing value, name:"forums Apple", container:account "Sur mon Mac", class:container, unread count:0}
# In fact it belongs to my account iCloud
end tell

2nd example
tell application "Mail"
every mailbox of account "iCloud"
--> {mailbox "forums Apple" of account "iCloud", mailbox "Trash" of account "iCloud", mailbox "Notes" of account "iCloud", mailbox "INBOX" of account "iCloud", mailbox "Drafts" of account "iCloud", mailbox "Sent Messages" of account "iCloud", mailbox "Deleted Messages" of account "iCloud", mailbox "Junk" of account "iCloud"}
every mailbox of account "Gmail"
--> {mailbox "[Gmail]/Important" of account "Gmail", mailbox "[Gmail]/Suivis" of account "Gmail", mailbox "[Gmail]/Tous les messages" of account "Gmail", mailbox "[Gmail]/Brouillons" of account "Gmail", mailbox "[Gmail]/Messages envoyés" of account "Gmail", mailbox "[Gmail]/Corbeille" of account "Gmail", mailbox "[Gmail]/Spam" of account "Gmail", mailbox "Deleted Messages" of account "Gmail", mailbox "Personnel" of account "Gmail", mailbox "Professionnel" of account "Gmail", mailbox "Reçus" of account "Gmail", mailbox "Sent Messages" of account "Gmail", mailbox "Notes" of account "Gmail", mailbox "INBOX" of account "Gmail"}
every mailbox of account "koenig.yvan SFR"
--> {mailbox "INBOX" of account "koenig.yvan SFR", mailbox "Drafts" of account "koenig.yvan SFR", mailbox "Sent Messages" of account "koenig.yvan SFR", mailbox "Deleted Messages" of account "koenig.yvan SFR", mailbox "Junk" of account "koenig.yvan SFR"}
every mailbox of account "Sur mon Mac"
--> error number -1728 from account "Sur mon Mac"
end tell

As you see, the 1st example state that some (in fact most of them) mailboxes belong to account "Sur mon Mac" but when I ask it to list them it fails.
To get the mailboxes of account "Sur mon Mac" I must use the instruction "every mailbox"
It must be a logic behind that but I don't see it.

Yvan KOENIG (VALLAURIS, France) dimanche 18 mai 2014 12:49:11



 _______________________________________________
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: 
 >Script works on my machine, returns 0 results on another (From: Alex Hall <email@hidden>)
 >Re: Script works on my machine, returns 0 results on another (From: Alex Hall <email@hidden>)
 >Re: Script works on my machine, returns 0 results on another (From: "koenig.yvan" <email@hidden>)
 >Re: Script works on my machine, returns 0 results on another (From: Thomas Fischer <email@hidden>)

  • Prev by Date: Re: Script works on my machine, returns 0 results on another
  • Next by Date: Re: Dictionary disapears when renaming app.
  • Previous by thread: Re: Script works on my machine, returns 0 results on another
  • Next by thread: Re: Script works on my machine, returns 0 results on another
  • Index(es):
    • Date
    • Thread