Jump to content

How can I use copied path of a selected file in a workflow?


Recommended Posts

Hello, new to Alfred and working on my first workflow. It's supposed to take the path of a file that I recently selected (and copied) and include it in an external link in my Obsidian notes. (Basically I want a quick way of linking external files in my Obsidian notes, without having to right click on the file and holding down opt to reveal copy path, etc.). I want to create the link so that the word I then select in Alfred will be revealed as the text of the link. Telling Alfred to copy and paste this to clipboard:   [{query}](<file:/{clipboard:1}>) won't work since the clipboard will just be inserted in case I copied plain text, but not the file path. Could anyone help me how I would achieve that? 

Edited by laleleona
Link to comment

hello @laleleona you will still need to convert the path to a link that Obsidian can open. I have been using this workflow based on a Javascript script from @deanishe. You can use it in 2 ways: 1) find the file (or folder!) with Alfred, then open file actions (➡️ key), or 2) select the file in Finder, then open Universal Actions (default shortcut: ctrl-cmd-\) and select `get markdown link`.  In both cases you are prompted to enter the link-associated text. The markdown link is copied to clipboard and pasted to the frontmost application if possible. I hope this helps!

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...