Jump to content
Migs

Copy path of selected file to clipboard

Recommended Posts

I have found how to do this in a service after creating an Automator workflow BUT:  I would like to have it be and alfred text that I can simply call from Alfred as such:  Open alfred typing box and type copypath and in the clipboard the path goes.  

As an aside, when I use the copypath as a service I cannot directly paste the path into an Excel cell.  I have to first copy it into a note and then copy it again from there and then paste it into a cell in Excel.  Can I correct this behavior in Automator prior to creating the service?  Or is there an altogether better way?

 

Thanks again amigos,

Migs

Edited by Migs
add info

Share this post


Link to post

Hi @Migs, You can use File Actions to copy the selected file's path to clipboard by finding your file in Alfred, pressing the right arrow (which will show you a list of File Actions) then selecting Copy Path to Clipboard. It'll then be copied to Alfred's clipboard, ready for you to paste in Excel. :)

 

Cheers,
Vero

Share this post


Link to post

Hi Vero:

In the attached screen shot I show a file and Alfred won't find it.  It goes straight to offer Google.  Thus I would rather select the file (much faster) and do something in Alfred to copy it's path to the clipboard.  As you will appreciate the path is quite long. (look at the bottom)

 

Thanks Vero,

 

Migs

 

alf.jpeg

Share this post


Link to post

If Alfred doesn't find your file, then there's a problem with your Spotlight index or it's not in your Alfred Search Scope. However, to get the path from your selection in Finder, just use the "Copy Path to Clipboard" action of Alfred File Action feature. To use it, make sure to assign a hotkey from the Alfred Preferences to get the file selection: "Alfred Preferences > Features > File Search > Actions > File Selection". Then, when you have the file selected in Finder, just use your hotkey to pop the Alfred's list of actions and look for the one named "Copy Path to Clipboard", press Enter and you should have it in your clipboard and you should be fine pasting it in Excel.

 

If you want to use a keyword instead the way you are saying it, then you will need a Workflow. So here is one if you prefer this solution: https://nofile.io/f/pmC0ht6SFGP/File+Path+To+Clipboard.alfredworkflow

Share this post


Link to post

@Migs First, could you please let me know how you're searching for this file?

 

You need to prefix your search term with the keyword "open" or press the spacebar to broaden the file types searched from the essential file types in the Default Results prefs to the rest of your Mac. 

 

Unless you've included Documents in your default search scope (not recommended), they won't pop up when you simply type "Medidas" for example.

 

So before we assume that there are indexing issues, could you please try searching by pressing the spacebar followed by your keyword, and let us know how you get on? :) 

 

Cheers,
Vero

 

 

Share this post


Link to post

Hi Verito

I just fixed the search scope.  I foolishly assumed all mounted volumes would be searched.  (I have many mounted volumes) That is why the file wasn't being found.  Let me explore your two solutions and see what works best.  Thanks for all your good will to me.

 

Migs

Share this post


Link to post

Hi Vero:

 

Is there a way to get the whole path to the file in the clipboard (using the Alfred keyboard shortcut)?  As you know I have about 10 volumes connected to my Mac.

 

Thanks Verito!

 

Migs

Share this post


Link to post

@Migs What exactly are you trying to do?

 

I explained how to copy the file path to clipboard in my first response:

 

On 11/10/2017 at 2:30 PM, Vero said:

You can use File Actions to copy the selected file's path to clipboard by finding your file in Alfred, pressing the right arrow (which will show you a list of File Actions) then selecting Copy Path to Clipboard. It'll then be copied to Alfred's clipboard, ready for you to paste in Excel. :)

 

To reiterate, when you either:

  • find the File in Alfred and press the right arrow to show File Actions, or
  • find a file in Finder and press the File Selection hotkey (Alt + Cmd + \ by default)

You will see the File Actions list like so:

file-actions.png

 

You'll then be able to choose "Copy Path to Clipboard" to copy the path of the file to your clipboard.

 

If we've misunderstood your question, could you please clarify what you're trying to achieve?

 

Cheers,
Vero

Share this post


Link to post

Your keyboard shortcut does just what I need Verito.  Thank you so much and may others always benefit from your kindness and wisdom.

Migs

Edited by Migs
spelling

Share this post


Link to post
Posted (edited)
On 11/14/2017 at 4:31 AM, Vero said:

@Migs What exactly are you trying to do?

 

I explained how to copy the file path to clipboard in my first response:

 

 

To reiterate, when you either:

  • find the File in Alfred and press the right arrow to show File Actions, or
  • find a file in Finder and press the File Selection hotkey (Alt + Cmd + \ by default)

You will see the File Actions list like so:

file-actions.png

 

You'll then be able to choose "Copy Path to Clipboard" to copy the path of the file to your clipboard.

 

If we've misunderstood your question, could you please clarify what you're trying to achieve?

 

Cheers,
Vero

 

About 5x per day I need a access a file path on my Mac IOS 10.13.6.  I have the latest version of Alfred.

 

Following your instructions, I 1) find the file in Alfred, 2) I highlight it, 3) I press the right arrow, and 4) NOTHING HAPPENS.  No "list of file actions" appears; hence, there is  no option to copy the path to the clipboard. 

 

What do you recommend?  

 

I purchased the powerpack and ownloaded the workflow file you mentioned for copying file paths, How/where do I install it so that Alfred will copy the file path names to the clipboard and/or at least enable me to access them? 

 

Thanks for your help - 

Edited by linda

Share this post


Link to post
On 3/5/2019 at 1:22 AM, linda said:

 

About 5x per day I need a access a file path on my Mac IOS 10.13.6.  I have the latest version of Alfred.

 

Following your instructions, I 1) find the file in Alfred, 2) I highlight it, 3) I press the right arrow, and 4) NOTHING HAPPENS.  No "list of file actions" appears; hence, there is  no option to copy the path to the clipboard. 

 

What do you recommend?  

 

I purchased the powerpack and ownloaded the workflow file you mentioned for copying file paths, How/where do I install it so that Alfred will copy the file path names to the clipboard and/or at least enable me to access them? 

 

Thanks for your help - 

 

Did you try tab instead of right arrow? It depends on your settings under Features ➡️ Files search ➡️ Actions.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...