Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'BUG Fix - Posix Path not enough' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
BUG Fix - Posix Path not enough
Authored by: Krioni on Nov 26, '02 01:48:35PM
[reposted for correct formatting]

Posix Path used to include escaped characters so spaces, etc would survive on the shell. In OS X 10.2, at least (and maybe elsewhere), you need to use quoted form of Posix Path, rather than just Posix Path:

on open filelist
repeat with i in filelist
do shell script "my_command " & quoted form of POSIX path of i
end repeat
end open

With just Posix Path you'll get errors whenever the path includes something the shell doesn't like.

[ Reply to This | # ]
BUG Fix - Posix Path not enough
Authored by: ClarkGoble on Dec 30, '02 03:24:25PM
If you add the "quote form" to the Posix make sure you modify your scripts accordingly. For instance the .ps -> .pdf filter/opener I gave will stop working. That's because I added the quotes myself. If you want to use that filter I wrote change it to:
on open input_file do shell script "export PATH="$PATH":/sw/bin;ps2pdf" & POSIX path of input_file & " /tmp/.psview.tmp.pdf" do shell script "open /tmp/.psview.tmp.pdf" end open
Note that I also change the location of the temporary file to be in the /tmp directory. That directory deletes all files older than two weeks. So it is a good place to put a .pdf file rather than hidden in you home directory. That may save you are few hundred k.

[ Reply to This | # ]