• 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: Want to get the full path of the mailbox
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Want to get the full path of the mailbox


  • Subject: Re: Want to get the full path of the mailbox
  • From: Bill Hernandez <email@hidden>
  • Date: Mon, 18 Dec 2006 10:10:14 -0600


On Dec 17, 2006, at 2:14 PM, Robert Nicholson wrote:

The name only gives me the last component is there a way to get the full path of the mailbox with Mail.app?


Robert,

I wrote this for you, hope it helps...

It works with multiple selections at any level of your mailbox hierarchy, not just at the INBOX level

Best regards,

Bill Hernandez
Plano, Texas

on script_title()
(*
Filename : mail_message_paths.scpt (Script Debugger)
Author : Bill Hernandez
Version : 1.0.0
Updated : Sunday, December 17, 2006 ( 7:25 PM )
*)
end script_title
-- +---------+---------+---------+---------+---------+--------- +---------+---------+---------+---------+
on script_notes()
(*
Question :
Want to get the full path of the mailbox
The name only gives me the last component is there a way to get the full path of the mailbox with Mail.app?


Answer :
This script allows you to select several messages and returns the paths to the messages
It returns them as a string that you can write to a file, send to the clipboard,
or select from a list..
*)
end script_notes
-- +---------+---------+---------+---------+---------+--------- +---------+---------+---------+---------+
tell application "Mail"
activate
set m_sel to selection
set aList to {}
set delim to "/"
repeat with m_ref in m_sel
set done to false
set s to ""
set aL to {}
set m_subject to subject of m_ref
set theMailBox to mailbox of m_ref
repeat until done
try
set aL to aL & (get the name of the theMailBox)
set theMailBox to container of theMailBox
on error
set done to true
end try
end repeat
set aL to reverse of aL


      repeat with theItem in aL
         set s to s & (delim & theItem)
      end repeat
      set aList to aList & (s & delim & m_subject)
   end repeat

-- ( 1 ) THIS RETURNS A STRING OF ALL THE SELECTED ITEMS
set str to ""
repeat with theItem in aList
set str to str & (theItem & return)
end repeat
display dialog str buttons {"OK"} default button {"OK"} giving up after 15


-- ( 2 ) HERE A CHOICE LIST SO YOU CAN REFINE THE RESULTS
set aChoices to choose from list aList with prompt "Please Choose" with multiple selections allowed
set str to ""
repeat with theItem in aChoices
set str to str & (theItem & return)
end repeat
display dialog str buttons {"OK"} default button {"OK"} giving up after 15


end tell


_______________________________________________ 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/mailman//archives/applescript-users

This email sent to email@hidden
References: 
 >Want to get the full path of the mailbox (From: Robert Nicholson <email@hidden>)

  • Prev by Date: Re: Picturebox to graphic box
  • Next by Date: Re: Picturebox to graphic box
  • Previous by thread: Re: Want to get the full path of the mailbox
  • Next by thread: Can't get every document file of every folder of startup disk whose creator type = "MSIE"
  • Index(es):
    • Date
    • Thread