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


Click here to return to the 'AppleScript getPath' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
AppleScript getPath
Authored by: kerbaugh on Oct 10, '02 08:35:48PM

It appears that "Preview" shows something different from what is actually posted. Specifically, "Preview" required eight backslashes to get four in the sed script. However, eight were actually posted. I will post it just once more, but no matter what is posted, the correct number of backslashes is four. Here is the (hopefully) correct script:

try
tell application "Finder" to set the source_folder to (folder of the front window) as alias
on error -- no open folder windows
set the source_folder to path to desktop folder as alias
end try

set thePath to (POSIX path of the source_folder as string)
do shell script "echo -n " & (thePath) & " | /usr/bin/sed 's/ /\\\\ /g' | /usr/bin/pbcopy"



[ Reply to This | # ]