Re: posix path conversion
Re: posix path conversion
- Subject: Re: posix path conversion
- From: Paul Skinner <email@hidden>
- Date: Fri, 14 Feb 2003 17:23:31 -0500
On Friday, February 14, 2003, at 05:09 PM, Michelle Steiner wrote:
On Friday, February 14, 2003, at 02:17 PM, Paul Skinner wrote:
Any clues?
This is the closest I can come:
tell application "Finder" to set dname to name of startup disk
set foo to "/Users/michelle/Desktop/Advance and Retreat"
set foo to POSIX path of foo
set bar to dname & (text 2 thru -1 of foo) as alias
-->alias "Dora:Users:michelle:Desktop:Advance and Retreat"
I hope that's enough to get you started there. How did you get the
Finder to give you a URL instead of a file path?
--Michelle
--
"There's some good in the world, Mr. Frodo, and it's worth fighting
for."
Thanks Michelle,
That's about what I went with. Parsing isn't a problem, but I had
thought there was a command I'd used earlier.
I now recall that it WAS posix path. Only this works sort of ok with
posix paths and not well at all with URLs.
set f to choose file
set f to POSIX path of f
return POSIX path of f
-->"/:Applications:Address Book.app:"
As for getting the URL from the finder. It's a property of every file.
Ask for it by name at your local finder. :)
set f to choose file
tell application "Finder"
url of file (f as text)
-->"file://localhost/Applications/Address Book.app/"
end tell
Very handy for posting!
--
Paul Skinner
"Gollum, dancing like a mad thing, held aloft the ring, a finger still
thrust within its circle. It shone now as if verily it was wrought of
living fire.
'Precious, precious, precious!' Gollum cried. 'My Precious! O my
Precious!' And with that, even as his eyes were lifted up to gloat on
his prize, he stepped too far, toppled, wavered for a moment on the
brink, and then with a shriek he fell. Out of the depths came his last
wail _Precious_, and he was gone."
- J.R.R. Tolkien - The return of the king
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.