Re: "~" vs. "POSIX file"
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