• 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: How can I open attachment in Mail ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How can I open attachment in Mail ?


  • Subject: Re: How can I open attachment in Mail ?
  • From: kai <email@hidden>
  • Date: Mon, 23 Oct 2006 18:53:10 +0100


On 23 Oct 2006, at 11:57, Philip Aker wrote:

On 2006-10-22, at 18:02:33, kai wrote:

on download_path()
set f to (do shell script "defaults read com.apple.mail MailDownloadsPath") & "/"
if f does not start with "~" then return f
set h to POSIX path of (path to home folder)
if (count f) < 3 then return h
h & f's text 3 thru -1
end download_path


do shell script "echo 'puts [file nativename [exec defaults read com.apple.mail MailDownloadsPath]]/' | tclsh"

Shorter, certainly (as one might expect from an all-shell approach) - though not necessarily faster. (The original executes approximately 2.5 times faster here.) Adopting a slightly more verbose form, to avoid the shell altogether, yields an even greater performance boost (about 5 times faster than the one-liner):


------------------
on download_path()
	set p to (path to preferences folder from user domain ¬
		as Unicode text) & "com.apple.mail.plist"
	tell application "System Events" to set f to value of ¬
		property list item "MailDownloadsPath" of property list file p & "/"
	if f does not start with "~" then return f
	set h to POSIX path of (path to home folder)
	if (count f) < 3 then return h
	h & f's text 3 thru -1
end download_path
------------------

---
kai


_______________________________________________ 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
  • Follow-Ups:
    • Re: How can I open attachment in Mail ?
      • From: Philip Aker <email@hidden>
References: 
 >How can I open attachment in Mail ? (From: Victor Frenklakh <email@hidden>)
 >Re: How can I open attachment in Mail ? (From: kai <email@hidden>)
 >Re: How can I open attachment in Mail ? (From: Philip Aker <email@hidden>)

  • Prev by Date: Re: do Shell Script & shell Script
  • Next by Date: Re: Mac dates ==> UNIX dates
  • Previous by thread: Re: How can I open attachment in Mail ?
  • Next by thread: Re: How can I open attachment in Mail ?
  • Index(es):
    • Date
    • Thread