 |
 |
how do i easily copy the pathway to a file?
|
 |
|
 |
|
Forum Regular
Join Date: Aug 2002
Status:
Offline
|
|
I used to have a script that allowed me to copy the entire path to an internal folder or file. For example instead of manually typing "Computer>System>Library>PreferencePanes>Print AndF ax.prefPane" to tell someone the path to something, I used to have a script that allowed me to click on PrintAndFax.prefPane and then hit the script and copy and paste the entire path to a textedit document. I thought it was called 'Get Path' but I can't locate it now. Anybody know what it's called and where it can be found.
Thanks,
Lou
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Sep 2006
Status:
Offline
|
|
Terminal will expose the path and give you something to copy and paste.
Drag the file into a Terminal window, done!
|
|
|
| |
|
|
|
 |
|
 |
|
Posting Junkie
Join Date: Feb 2005
Location: 888500128
Status:
Offline
|
|
dragging it into the text entry box down below here works, as well.
|
|
|
| |
|
|
|
 |
|
 |
|
Forum Regular
Join Date: Aug 2002
Status:
Offline
|
|
Originally Posted by Sherman Homan
Terminal will expose the path and give you something to copy and paste.
Drag the file into a Terminal window, done!
Yes this works but it puts in extra characters. The script that I used just gave the pathway with backslashes between folders. I swear it was called Get Path but I couldn't find it with a Google search.
|
|
|
| |
|
|
|
 |
|
 |
|
Forum Regular
Join Date: Aug 2002
Status:
Offline
|
|
Originally Posted by analogika
dragging it into the text entry box down below here works, as well.
This works perfectly it's easy to copy and paste and there are no extra characters as with Terminal. The problem however is that you need to log into this forum, or probably others, open a message; and then drag the file of interest into the text box. I only had to drag the file of interest on the script that resided in my dock with the script that I used to have.
|
|
|
| |
|
|
|
 |
|
 |
|
Addicted to MacNN
Join Date: Aug 2004
Location: FFM
Status:
Offline
|
|
Open Automator and create the following workflow:
Then go to File->Save As Plug-In and save it as a plug-in for "Finder" with the name "Copy POSIX Path". From now on you can copy the path of any file from within the context menu in Finder (Other->Automator->Copy POSIX Path).
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Nov 2003
Location: The back of the room
Status:
Offline
|
|
Mac style paths:
tell application "Finder" to set the clipboard to the selection
Unix style paths:
tell application "Finder" to set the clipboard to POSIX path of (the selection as alias)
(Last edited by zro; Jan 17, 2008 at 08:35 AM.
(Reason:Made the Unix path a 1-liner))
|
|
|
| |
|
|
|
 |
|
 |
|
Forum Regular
Join Date: Aug 2002
Status:
Offline
|
|
I made the script saved it as a plug in for Finder and am able to go to a file and select Other->Automator->Copy Posix Path. I then tried to paste this into Texedit but the path would not paste. Am I doing something wrong. My automator workflow looks exactly like yours.
Thanks for the help. Once this works for me it will be perfect.
Thanks again.
Lou
|
|
|
| |
|
|
|
 |
|
 |
|
Addicted to MacNN
Join Date: Aug 2004
Location: FFM
Status:
Offline
|
|
Did you enter the script exactly as shown in the screenshot? The workflow worked for my when I created it.
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Jan 2001
Status:
Offline
|
|
No, no, no. You use this:
FilePathCM
Description from site:
FilePathCM is a contextual menu item for copying the:
POSIX path
HFS path
Full name
Display name
Extension
Windows style path
of a file or folder to the clipboard.
It can also be used for creating URLs from file paths, such as AFP type URLs. This is achieved using "prefixes" which are simply prepended to a URL encoded version of a POSIX path.
Or you could use this free one, which is not as good:
Hsoi's Shop: Software
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Nov 2003
Location: The back of the room
Status:
Offline
|
|
Or you could do all that (and more) yourself using AppleScript and plug it into the Finder using Automator. For free.
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Jan 2001
Status:
Offline
|
|
Yeah, but Applescripts and AUtomator actions are slower.
|
|
|
| |
|
|
|
 |
|
 |
|
Forum Regular
Join Date: Aug 2002
Status:
Offline
|
|
Here is what I typed in Automater:
on run {input, parameters}
return POSIX path of input
end run
As you can see, I just copied the text and placed that in (not a picture like you did). But it looks identical to yours as far as I can tell. It still doesn't work though when I try and paste it into text edit after following your instructions: select Other->Automator->Copy Posix Path.
Am I not allowed to paste into text edit?
Sorry for the long delay in my response. It's been a hectic week.
Lou
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Jun 2003
Location: Newport News, VA USA
Status:
Offline
|
|
Did you add the "Copy to Clipboard" action?
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Nov 2003
Location: The back of the room
Status:
Offline
|
|
Or just use this as the AppleScript...
tell application "Finder" to set the clipboard to POSIX path of (the selection as alias)
|
|
|
| |
|
|
|
 |
|
 |
|
Addicted to MacNN
Join Date: Jun 1999
Location: Las Vegas, NV, USA
Status:
Offline
|
|
Originally Posted by louh
The script that I used just gave the pathway with backslashes between folders.
Those are slashes, NOT backslashes! Only Windows uses backslashes.
|
|
|
| |
|
|
|
 |
|
 |
|
Forum Regular
Join Date: Aug 2002
Status:
Offline
|
|
Originally Posted by cybergoober
Did you add the "Copy to Clipboard" action?
Thanks cybergoober for finding my mistake. It slipped my mind to include the "Copy to Clipboard". Also thank you TETENAL for writing out the script that best serves my needs. You had everything there I needed I just can't read sometimes - duh-!
Also thanks to everyone else for their suggestions. This forum is by far the best around.
Lou
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|