• 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: build a list of mailboxes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: build a list of mailboxes


  • Subject: Re: build a list of mailboxes
  • From: "koenig.yvan" <email@hidden>
  • Date: Sun, 09 Mar 2014 10:54:06 +0100


Le 09/03/2014 à 10:08, Axel Luttgens <email@hidden> a écrit :


Le 8 mars 2014 à 18:13, koenig.yvan a écrit :

Hello

I wished to build a list of every mailboxes available in my Mail datas

I wrote this script :

[...]

Is there a way  to achieve my goal without the dirty trick deciphering an error message ?

Hello Yvan,

For sure not as quick nor as efficient as the "error message trick", but probably more reliable, my MboxFullName() handler still "works" here on Mountain Lion.

on MboxFullName(Mbox)
tell application "Mail"
if name of container of Mbox is missing value then return name of Mbox
return my MboxFullName(container of Mbox) & "/" & name of Mbox
end tell
end MboxFullName

tell application "Mail"
set liste to {}
repeat with Mbox in mailboxes
copy my MboxFullName(Mbox) to the end of liste
end repeat
end tell

HTH,
Axel


Hello Axel

I was editing the beginning of my original script this way :

tell application "Mail"
set name1 to name of first mailbox


try
first mailbox as rich text
on error errMsg
set delim1 to item 1 of my decoupe(errMsg, name1)
end try
set asListe to {}
repeat with i from 1 to count every mailbox
set aBox to mailbox i
try
aBox as rich text
on error errMsg
my decoupe(errMsg, {delim1, quote & " of application " & quote & "Mail" & quote})
set end of asListe to item 2 of result
end try
end repeat
end tell

my recolle(asListe, return)

my writeto((path to desktop as text) & "mailboxes.txt", result, text, false)

when I received your script.

It's exactly what I was dreaming of but was enable to think to.

It uses recursion which has bad reputation.
It's why I call it Georges's coding, but with path to mailboxes there is no problem.
I must add that it's fast too.

Yvan KOENIG (VALLAURIS, France) dimanche 9 mars 2014 10:48:21



Au village, sans prétention,
J'ai mauvaise réputation.
Qu'je m'démène ou qu'je reste coi
Je pass' pour un je-ne-sais-quoi!
Je ne fait pourtant de tort à personne
En suivant mon chemin de petit bonhomme.
Mais les brav's gens n'aiment pas que
L'on suive une autre route qu'eux,
Non les brav's gens n'aiment pas que
L'on suive une autre route qu'eux,
Tout le monde médit de moi,
Sauf les muets, ça va de soi.

To get the complete lyrics :
http://www.parolesmania.com/paroles_georges_brassens_9624/paroles_la_mauvaise_reputation_334313.html

To listen :
http://www.dailymotion.com/video/x2kfvo_georges-brassens-la-mauvaise-reputa_music
http://www.wat.tv/video/brassens-mauvaise-reputation-19319_2hp3d_.html
http://www.musictory.fr/musique/Georges+Brassens/La+Mauvaise+Réputation



 _______________________________________________
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: 
 >build a list of mailboxes (From: "koenig.yvan" <email@hidden>)
 >Re: build a list of mailboxes (From: Axel Luttgens <email@hidden>)

  • Prev by Date: Re: build a list of mailboxes
  • Next by Date: Re: Scriptable multi-clipboard utility?
  • Previous by thread: Re: build a list of mailboxes
  • Next by thread: Files and Aliases
  • Index(es):
    • Date
    • Thread