Re: mac to unix path names
Re: mac to unix path names
- Subject: Re: mac to unix path names
- From: Christopher Nebel <email@hidden>
- Date: Sat, 3 May 2003 15:20:54 -0700
On Friday, May 2, 2003, at 11:09 PM, Reinhold Penner wrote:
So far so good. Now let's also change the disk name to "disc
tr<egrave>s dur" and access a file I called "test.rtf"
set dskTop to ((path to desktop folder) as Unicode text)
--> "disc trhs dur:Users:alaweo:Desktop:" --fine
set x to quoted form of POSIX path of (dskTop & "test.rtf")
--> "'/disc trhs dur/Users/alaweo/Desktop/test.rtf'" -still fine
do shell script "open " & x
--> 2003-05-02 20:05:13.381 open[858] No such file: /disc tr\\350s
dur/Users/alaweo/Desktop/test.rtf
This has got to be a bug.
It is, but it's not the one you think. The path that got generated was
bogus, so open(1) was perfectly correct in claiming that there was no
such file. At first, I thought this just had to do with renaming the
disk -- there have been issues in the past with synchronizing such
changes between various layers -- but you only appear to get this
problem if there are interesting characters in the name.
The workaround is quite simple: get the POSIX path of the original
alias, not the one converted to Unicode text:
set dskTop to path to desktop folder
set x to quoted form of ((POSIX path of dskTop) & "/test.rtf")
Like I said before, POSIX path is not documented to work on strings.
The fact that it does was entirely unintentional and is not supported.
--Chris Nebel
Apple Development Tools
_______________________________________________
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.