You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

How to get a clean file path in OS X Yosemite?

I need to get file paths for Stata. Before Yosemite, I have to bare with the cmd+I and copy from the information panel. After I upgrade to Yosemite, cmd+I gives me a path look like this: User -> file1-->.... Now, I need to delete E-V-E-R-Y --> after I copy this path into Stata in order to set up the working directory. Is there a way I can work around with this and get a simple clean file path such as \user\aaa\aaa\aaa\aaa.

Thanks.

MacBook Pro, OS X Yosemite (10.10)

Posted on Oct 19, 2014 4:42 PM

Reply
Question marked as Top-ranking reply

Posted on Oct 19, 2014 5:02 PM

Drop the file into a Terminal window.

40 replies

Nov 5, 2014 9:54 AM in response to cynthy_macprouser

Annoyingly, this has always been easy on Windows. So many simple things like this has been simple on Windows. And I've since moved to Mac and learnt that if my mouse dies, I am almost unable to use the computer. (Then again, at least I don't have to use Windows 8).


I'd suggest just doing the textEdit drag, it does the job, just another workaround for an OS I thought would have such simple intuitive features that "Just Works", makes you wonder what the developers themselves use!

Nov 27, 2014 7:50 AM in response to cynthy_macprouser

I think everybody makes great points. For everybody that gave ideas on how to get a clean file path Thank You. For anybody that wants to send Apple feedback about this or anything else related to Mac OSX or the Finder can do so here: https://www.apple.com/feedback/macosx.html


Another way you can get the path, and yes I'm aware its cumbersome, is you can open the "Go to Folder" window and drag your folder or file into it and it will give you the path. Free of modifiers and without opening another application.


I find it works best if when you start there is no Finder windows open. If you leave one open you just have to open another one as it doesn't let you drag and drop from the one with the "Go to Folder" window in it.


Finder has to be Active > Select Go ( Menubar ) > Go to Folder...

Or you can use the keyboard shortcut ( Command ) ( Shift ) ( G )


At this point I like to clear out the address field as if there is anything in there it will stay.


Next Open a new Finder window.

Examples on how to: Select File > New Window, or the keyboard shortcut ( Command ) ( N )


Find the File or Folder your interested in then drag and drop it in the Address Field of the "Go to Folder" window and it will give you the path.


Best of Luck and Hope that helps,

Weston

Jan 1, 2015 3:32 PM in response to cynthy_macprouser

The \ before a space is completely normal - spaces and other special characters have to be preceeded with a backslash or \ character - you can also inclose the full name in double quotes. For example the file name is


/Macintosh HD/Users/myuser/myfile name is abcd


would always be entered as


/Macintosh\ HD/Users/myuser/myfile\ name\ is\ abcd


or with quotes as


"/Macintosh HD/Users/myuser/myfile name is abcd"


If the Stata software can't digest the backslashes and spaces then you perhaps shouldn't use "special" characters in file names



Good luck...

Mar 5, 2015 9:09 AM in response to cynthy_macprouser

There is an easy way. Make a new finder window (separate from the window with the file), and on that new window press Command + Shift + G. Delete any text in the prompt. Then, move the new window down and drag the file that you wish to obtain the path of onto the bar titled "Go to the folder:" in the new window. It should give you a file path.


Hope this helps! Reply if you have any questions or need more help!


Best Regards,


OSX Enthusiast

How to get a clean file path in OS X Yosemite?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.