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:27:33PM

   I have a little AppleScript that does the same thing but it puts the path in the clipboard so that it's easy to paste into the Terminal or whatever app you like. If you add it to /Library/Scripts and you have ScriptMenu installed, it's rather convenient to use.

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 | # ]