• 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: "~" vs. "POSIX file"
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: "~" vs. "POSIX file"


  • Subject: Re: "~" vs. "POSIX file"
  • From: kai <email@hidden>
  • Date: Wed, 25 Oct 2006 02:01:21 +0100


On 25 Oct 2006, at 01:23, Gnarlodious wrote:

Mark J. Reed wrote:

Alternatively there's this woefully inefficient option which I
unhesitatingly fail utterly to recommend.

POSIX file (do shell script "echo ~/Desktop/some.txt")

I use this method, which has always served me well:

POSIX file (do shell script "echo $HOME/Desktop/some.txt")

Is that as "woefully inefficient" as your method?

Bearing in mind the comments already made about the context of speed comparisons (not to mention the philosophy that optimisation is probably only necessary if you feel that it is), the following are typical results here - run from Script Editor. (The ratios can also differ somewhat on different machines/systems.)


--------------------
Index: 100 = fastest
--------------------

6101: POSIX file (do shell script "echo $HOME/Desktop/some.txt")

6087: POSIX file (do shell script "echo ~/Desktop/some.txt")

586: POSIX file (POSIX path of (path to home folder) & "Desktop/ some.txt")

 100: POSIX file ((system attribute "HOME") & "Desktop/some.txt")

--------------------

---
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: "~" vs. "POSIX file"
      • From: "Mark J. Reed" <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>)
 >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>)
 >"~" vs. "POSIX file" (From: Christopher Nebel <email@hidden>)
 >Re: "~" vs. "POSIX file" (From: "Mark J. Reed" <email@hidden>)
 >Re: "~" vs. "POSIX file" (From: Gnarlodious <email@hidden>)

  • Prev by Date: Re: "~" vs. "POSIX file"
  • Next by Date: Re: "~" vs. "POSIX file"
  • Previous by thread: Re: "~" vs. "POSIX file"
  • Next by thread: Re: "~" vs. "POSIX file"
  • Index(es):
    • Date
    • Thread