Re: getting a file by URL ?
Re: getting a file by URL ?
- Subject: Re: getting a file by URL ?
- From: "Mark J. Reed" <email@hidden>
- Date: Sun, 30 May 2010 16:06:50 -0400
file:///Macintosh HD is an invalid path. In POSIX/URL land, the boot volume's name is nowhere to be seen; POSIX file "/" and POSIX file "file:///" both refer to HFS file "Macintosh HD:" (or whatever your boot volume's name is).
OMM (10.6.3), the indirect version with the variable works fine.
On Sun, May 30, 2010 at 3:38 PM, Thomas Fischer
<fischer.th@aon.at> wrote:
Hi Mark,
I don't get your suggestion to work:
tell application "System Events"
try
set myFile to POSIX file myURL
end try
log myFile
get POSIX path of myFile
end tell
results in
tell application "System Events"
get POSIX file "file:///Macintosh HD/Users/Thomas/Desktop/Test.txt"
--> error number -1728 from POSIX file "file:///Macintosh HD/Users/Thomas/Desktop/Test.txt"
(*file Macintosh HD:Macintosh HD:Users:Thomas:Desktop:Test.txt*)
get POSIX path of file "Macintosh HD:Macintosh HD:Users:Thomas:Desktop:Test.txt"
--> error number -1700 from «class posx» of file "Macintosh HD:Macintosh HD:Users:Thomas:Desktop:Test.txt" to reference
So the first problem is:
System Elends accepts
but not
set myFile to POSIX file myURL
which I find strange.
And then the result of the POSIX file command is
file Macintosh HD:Macintosh HD:Users:Thomas:Desktop:Test.txt
which obviously won't word because of the double "Macintosh HD".
Or am I doing it wrong?
Emmanuel's satimage osax solutions work OK, however.
Thomas
Am 30.05.2010 um 20:53 schrieb Mark J. Reed:
_______________________________________________
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
--
Mark J. Reed <email@hidden>
_______________________________________________
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