Jump to content

Copy file name


Recommended Posts

When I have tapped space twice to search for a file, and then hit the right arrow, is there an option to copy the entire file name? Similar to 'Copy Path to Clipboard' but instead of entire path, just the filename?

Link to comment

In addition, if you go to Alfred Preferences → Features → Universal Actions and on the Actions tab ensure Workflow Universal Actions is checked (it probably is by default) you can do exactly what you wish—when you hit the right arrow in Alfred's search results you'll see your workflow there.

 

Stephen

Link to comment

@luciano you can also make connections between objects by hovering over an object, then dragging from the little teal coloured connection on the right hand side of the object to the object you want to connect to. Objects which accept an incoming connection will highlight as you start to drag.

Link to comment

I'm trying to make a similar workflow to this. I need to get the path, then add some text.

 

Let's say I have the file "some_data.txt" on my Desktop.

 

I need to get the path /Desktop/some_data.txt

 

Then I need to add the text read_excel, some quote marks and brackets and copy it to clipboard. So what should be copied to clipboard is this:

 

read_excel("/Desktop/some_data.txt")

 

Attached is what I have so far. I just need to figure out how to add text to the path.

 

image.thumb.jpeg.a0239ac940bab94ad46238a98cf52775.jpeg

 

 

Link to comment

Thanks done. Although just noticed it only copies the path and not file name. How can I copy both path and file name?

 

It does this:

 

read_excel("/Desktop")

 

But what I need is this:

 

read_excel("/Desktop/some_data.txt")

 

Link to comment

Open Alfred's window, press <space> then type the file name then press right arrow, start typing the name of your Universal Action and use it like that.

 

Note: that relies on you going to Alfred Preferences → Features → Universal Actions, then clicking on the Actions tab and ensuring Workflow Universal Actions is checked (so that you'll see the UA listed when you press the right arrow after seeing the file name).

 

Stephen

Link to comment

Quick note: If you want the full path, you don’t even need the Automation Task, you can connect the Universal Action directly to the Copy to Clipboard.


Considering your last post, you might want a File Filter instead of a Universal Action.


I highly recommend you go through the interactive guide, as linked above. It’ll teach you the basics and help you to figure out how to figure out these details.

Link to comment

If I select a file in Finder this is copied to clipboard:

 

read_excel("/Users/luciano/Desktop/Sheet2.xlsx")

 

But if I try to run from Alfred search bar (by pressing space twice) this is all that is copied to clipboard.

 

read_excel("")

 

Any idea why path and file name not also being copied when run from search bar?

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...