luciano Posted February 2 Share Posted February 2 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
vitor Posted February 2 Share Posted February 2 You can build it. Connect a Universal Action to the Path Basename Automation Task, then to a Copy to Clipboard Output. Done. Link to comment
Stephen_C Posted February 2 Share Posted February 2 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 Posted February 6 Author Share Posted February 6 Got as far as attached. Am I missing connections between actions? How do I connect them? Link to comment
vitor Posted February 6 Share Posted February 6 Click on the first item, then hold ⌥ and click on the second one, then the third. I also recommend you see the Getting Started Guide for an interactive tutorial on making a workflow. Link to comment
Andrew Posted February 6 Share Posted February 6 @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
luciano Posted February 13 Author Share Posted February 13 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. Link to comment
Stephen_C Posted February 13 Share Posted February 13 Is the text the same every time or does it differ on each occasion? Stephen Link to comment
luciano Posted February 13 Author Share Posted February 13 Only thing that varies is the path. In all instances, I need to copy this to clipboard: read_excel("<<path>>") Link to comment
Stephen_C Posted February 13 Share Posted February 13 All you need to do is in the clipboard action add the text you want surrounding {query} (the latter being the passed in path). Stephen Link to comment
luciano Posted February 13 Author Share Posted February 13 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
Stephen_C Posted February 13 Share Posted February 13 If you set the Automation Task to Selection in Finder you will get the full path and file name. Stephen Link to comment
luciano Posted February 13 Author Share Posted February 13 Thanks for continuing help! I want this to run from the Alfred search bar, rather than having to select file in Finder. Is there a way to do that? Link to comment
Stephen_C Posted February 13 Share Posted February 13 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
vitor Posted February 13 Share Posted February 13 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. Stephen_C 1 Link to comment
luciano Posted February 13 Author Share Posted February 13 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
vitor Posted February 13 Share Posted February 13 Because you have the Automation Task that is copying the path from the Finder. As per above, you have to remove that because you’re going for a different result. Link to comment
luciano Posted February 13 Author Share Posted February 13 Thanks for your patience. It looks to be working now. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now