• 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: Mail scripting…
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Mail scripting…


  • Subject: Re: Mail scripting…
  • From: awaw <email@hidden>
  • Date: Wed, 9 Apr 2008 16:31:19 +0200

Thanks for that solution but…

It's not "perfect" too!
You have to known in advance the name of the subfolder… the solution is not "generic".
If I reoder folders or create new folder or subfolder… patatras!

Evenmore if you know that name if that name is not alone (more than one subfolder have that name, or that name is a part of the name of a folder )
it's difficult to use the result of "mb".

Elsewhere you are right : I have difficulties to interpret AppleScript dictionaries!

So, once more, thanks for your help.


Gérard


Le 9 avr. 08 à 08:17, Philip Aker a écrit :
On 08-04-07, at 09:54, awaw wrote:

Your solution is perfect if you know the name of the mbox (here "nubian/scripting") and write it explicitly in the script.

But I don't succeed in a script to know the fact that "scripting" is a sub folder of "nubian".
Is it possible?

What you should do is learn how to read and interpret .
Then you will see that Mail's dictionary shows that a mailbox has a 'container' property (i.e. parent mailbox):

tell application "Mail"
set mb to every mailbox whose name contains "scripting"
name of container of item 1 of mb & "/scripting"
end tell

--> "nubian/scripting"

So back up the chain of containers to get multiply-nested mailbox names.



How can I get this "property" and use it to construct dynamically the name of the mbox and reach
for example "Society/Computer/Apple" and then continue the script as under with "tell mailbox mbox"

There is a pseudo-code to illustrate my thinking.

 set xx to name of mailbox         -- "Society"
 If society has a subfolder then
     get name of that subfoder     -- "Computer"

     set xx to xx & "/" & result        -- "Society/Computer"
…/…
    set mbox to xx                          -- "Society/Computer/Apple"
    tell mailbox mbox                    
…/…

 Thanks for your help

Philip Aker
echo email@hidden@nl | tr a-z@. p-za-o.@





 _______________________________________________
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: 
 >Re: Mail scripting… (From: awaw <email@hidden>)
 >Re: Mail scripting… (From: Philip Aker <email@hidden>)

  • Prev by Date: Re: What is the limit on osascript command ?
  • Next by Date: Re: What is the limit on osascript command ?
  • Previous by thread: Re: Mail scripting…
  • Next by thread: Scripting Sound Control Panel
  • Index(es):
    • Date
    • Thread