Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

doubledee

macrumors 6502
Original poster
May 14, 2012
496
0
Arizona
In Mountain Lion, is there an easy way to get the File Path + Filename of a file selected in Finder?

(It seems like there was a way to do this in Snow Leopard - although it was a PITA - but I don't see anything in ML.)

There are lots of times I want/need this, and right now it would help when I check the SHA1 for apps I download.

For example, if I downloaded something like OpenOffice in my "reallyLongPathTo/zDownloads" directory, it would help to quickly copy the File Path + File name from Finder so I can paste it into Terminal and easily run a check on the SHA1 digest.

Sincerely,


Debbie
 

doubledee

macrumors 6502
Original poster
May 14, 2012
496
0
Arizona
This may help: How to copy a file path in OS X

For using a file path in Terminal, simply drag the file into the Terminal window.

I tried this...

Create a path-copying service
If you regularly need to copy a file path as text, an easier option would be to create a service in Automator that will do this for you. First launch Automator and create a new service workflow. Then make sure the inputs for it are "Files or Folders" in the Finder (done with the menus at the top of the workflow). Then drag the "Copy to Clipboard" action to the workflow area and save the service with a name like "Copy Path as Text."


So how do I find this "service" I created?

What if I need to rename it or delete it?


Debbie
 

doubledee

macrumors 6502
Original poster
May 14, 2012
496
0
Arizona
It may be simpler for you to just drag the file into the Terminal window to get the file path.

I'm going to try that when my OO download is done, and the script above works, but I just want to know where it is stored so if I ever want to Rename it, Copy it, Delete it, etc I know how to...


Debbie
 

Weaselboy

Moderator
Staff member
Jan 23, 2005
34,482
16,197
California
I'm going to try that when my OO download is done, and the script above works, but I just want to know where it is stored so if I ever want to Rename it, Copy it, Delete it, etc I know how to...


Debbie

Services are kept in this Folder. ~ = your personal users folder. Shift-command-g (all three at once) in Finder then paste this in and enter.

Code:
~/Library/Services
 

doubledee

macrumors 6502
Original poster
May 14, 2012
496
0
Arizona
Services are kept in this Folder. ~ = your personal users folder. Shift-command-g (all three at once) in Finder then paste this in and enter.

Code:
~/Library/Services

Is that a hidden directory?

If so, how do I show hidden directories in Finder?

Sincerely,


Debbie
 

Weaselboy

Moderator
Staff member
Jan 23, 2005
34,482
16,197
California
Is that a hidden directory?

If so, how do I show hidden directories in Finder?

Sincerely,


Debbie

Yes... by default the user library folder is hidden. You can option key click the Go menu in Finder to see it, or you can run the command below in Terminal to keep it unhidden. It will get hidden again every time a new OS update comes out like 10.8.5.

Code:
chflags nohidden ~/Library
 

doubledee

macrumors 6502
Original poster
May 14, 2012
496
0
Arizona
Yes... by default the user library folder is hidden. You can option key click the Go menu in Finder to see it, or you can run the command below in Terminal to keep it unhidden. It will get hidden again every time a new OS update comes out like 10.8.5.

Code:
chflags nohidden ~/Library

Is it bad to leave that unhidden?

And how would I reverse it?

Maybe...

Code:
chflags nohidden ~/Library

:confused:

Sincerely,


Debbie
 

Weaselboy

Moderator
Staff member
Jan 23, 2005
34,482
16,197
California
Is it bad to leave that unhidden?

And how would I reverse it?

You can hide it again with the command below, but there really is no downside to leaving it unhidden. Apple just hides it to keep uninformed users from getting in there are breaking things by tinkering around.

Code:
chflags hidden ~/Library
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.