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


Click here to return to the 'unix_path() handler unnecessary' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
unix_path() handler unnecessary
Authored by: jolinwarren on Feb 25, '03 11:53:37AM
Hello,

Just wanted to say that you can probably remove your unix_path() handler. To get a proper (& compatible) UNIX path, the easiest way is to use

quoted form of the POSIX path of

So your line: set inputFile to (unix_path(aFile))

would become: set inputFile to quoted form of the POSIX path of aFile

Another example:
do shell script "pdftotext " & inputFile & ¬
" /Users/username/Desktop/" & unix_path(newName) & ".txt"


becomes:
do shell script "pdftotext " & inputFile & ¬
" /Users/username/Desktop/" & quoted form of the POSIX path of newName & ".txt"


NOTE: I haven't been able to try these modifications to the script, but I believe the "quoted form of the POSIX path" function does what you are trying to accomplish with unix_path(). An extremely helpful technote to refer to when dealing with UNIX (and particularly do shell script) in AppleScript is:

http://developer.apple.com/technotes/tn2002/tn2065.html

The example I've given above comes from the "dealing with Files" section. Hope this helps.

Cheers,
Jolin

[ Reply to This | # ]
/tmp?
Authored by: Enkerli on Feb 26, '03 09:36:15AM

Is it just me or is /tmp a better choice for the temp files?



[ Reply to This | # ]