

Note: This doesn't escape spaces, so if your path has spaces, you may need to quote it. This Automator Service will now be in your Services menu. Save the Automator Service with whatever name you'd like it to have in the Services menu. Tell application "Finder" to set the clipboard to POSIX path of (target of window 1 as alias) Replace (* Your script goes here *) with: try Add a "Run AppleScript" action to the workflow.Change "Service receives selected" to no input (or "files or folders" to have it appear from a right click) and leave it set to any application (unless you only want it to work from a specific app, like the Finder).Open Automator and create a new Service.The path that is copied is simply text, so it can be pasted anywhere that you can paste text.
How to see a path in mac copy path windows#
This Automator Service will copy the path of the Finder's front window, rather than the path of a selected file or folder, so it won't affect what windows are open or what items are selected. Wait a second (watch the menu bar to see when the workflow has finished) and then switch to your target application and press Command-V.You can use Automator to do this with a single keyboard shortcut that you can use from any app, and without installing 3rd party software. Switch back to the Finder, select something, Control-click on it, then select your new workflow from the list. In the new window that appears, give your plug-in a name (Copy Path to Clipboard), set the Plug-in For pop-up to Finder, and click Save.

Replace the stock AppleScript text with the three-line script you see above, then choose File -> Save as Plug-in. Launch Automator, create a blank workflow, and then drag the Automator -> Run AppleScript (Utilities -> Run AppleScript in 10.5) action to the work area. If you prefer, you can also easily make this AppleScript a Finder contextual menu plug-in. When it quits, switch to your target application and press Command-V to paste the path. You’ll briefly see your program load into the dock, then quit. When you need the path to an item, first select that item, then click on your program’s Dock, sidebar, or toolbar icon. Now navigate to the spot where you saved your four-line program, and drag it to the Dock or to a Finder’s sidebar or toolbar area. Give your program a name (Get Path), save it somewhere safe (your user’s Documents folder), and set the File Format pop-up to Application, then click Save. Select File -> Save to bring up the Save dialog. Open Script Editor and enter these four lines: Select the path and copy it to your clipboard.īut what about one-step solutions? Is there any one-step method of getting the currently-selected item’s path from the Finder to the clipboard? While not quite a built-in solution, you can write a very simple AppleScript that will do this for you. Finally, you can drag a Finder window’s proxy icon-the small icon in the title bar of the window-into TextEdit (again, in plain text mode) to see the path to that folder. You can also press Command-Space, then drag-and-drop the file into the Spotlight search box. You’ll see the path on the command line you can then select it with the mouse and copy it. You can also copy any item (file or folder) in the Finder and paste it into Terminal.
