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

Copy and paste paths using Sticky Note service System
Have you ever needed to type a long pathname? Isn't it a pain? In the Finder, you can use the "Make Sticky Note" service to spit out the full directory path into a new sticky note.

I only have 10.2.1 so I don't know whether this is Jaguar only, but the Make Sticky Note service's default behavior in the Finder (when no text is selected) is to create a new sticky note with the text of the full path in the new note. This is similar to what you would get by doing a "pwd" in a terminal window, but this technique has a twist - select an item in a finder window and you get the filename appended to the full path too. Just go to the finder, click once on an item (to select it) in any Finder window. Then choose Finder -> Services -> Make New Sticky Note (or just hit Command+Shift+Y). A new sticky note is created with the full path to the item.
    •    
  • Currently 0.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (0 votes cast)
 
[2,590 views]  

Copy and paste paths using Sticky Note service | 5 comments | Create New Account
Click here to return to the 'Copy and paste paths using Sticky Note service' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Can use terminal too
Authored by: clarkjackson on Oct 10, '02 11:27:11AM

If you have terminal open you can accomplish the same thing by dragging a directory or file into the terminal window. You can copy and paste the path from there.



[ Reply to This | # ]
Re: Can use terminal too (Untrue)
Authored by: purplepixy on Oct 10, '02 08:19:55PM

This is not quite true. You get different results if any of your folder names or disk names include spaces. Applications such as NetUnfo Manager use the proper path names you get using the Stickies trick, rather than the UNIX cludge produced by the Terminal.

Path in Stickies:
/Volumes/Hard Disk/Users/master/Desktop/Another Folder

Path in Terminal;
/Volumes/Hard\ Disk/Users/master/Desktop/Another\ Folder



[ Reply to This | # ]
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 | # ]
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 | # ]
CopyPath
Authored by: kent37 on Oct 11, '02 03:52:57PM
Another solution is CopyPath which provides a contextual menu item to copy the path to the clipboard.
http://www.bergenstreetsoftware.com/

[ Reply to This | # ]