Macro to generate a quick look based on a file link

I routinely insert file links into documents and notes of apps such as Evernote, Scrivener, etc and am looking for a way create a macro that would generate a click look instead of the usual clicking on the link and opening the app+file.
thanks in advance for your time and help

How do you insert the file link?

1 Like

in Evernote, the only file link I can insert is the path in URL form.
I can easily use KBM to right click and copy link, so the link is in the clipboard.
Now the trick is to generate a quick look with the content of the clipboard.
Thank you for taking interest in my question.

Maybe something like this would work for you. Select the file path then trigger the macro to view in "Preview".

Show FilePath in Preview Macro (v9.0.5)

Show FilePath in Preview.kmmacros (2.1 KB)

No need for a variable. Just use the clipboard string:
Show FilePath in Preview Macro (v9.0.5)

Show FilePath in Preview.kmmacros (2.2 KB)

1 Like

Thank you for your post.
It does not work, neither with UNIX nor with URL path ('filename not found') for reasons that I don't understand because your macro makes sense and it straightforward.
That being said, I think that I did not express myself clearly: I specifically do not want to open the file. If I did, I would simply click on the link. Here you end up opening the file with Preview.
I just want a quick look analogous to what you get with Finder (or Pathfinder) -Spacebar
thanks again

I do understand what you were asking. I don't know how to invoke the "Quick Look" and thought "Preview" would be a similar approach since it opens many formats without the overhead of opening multiple applications.

1 Like

There is a command line interface to quicklook that you can therefore use in KM.

Here's an example using iTerm2:

I don't have time right now to explore further, so I can't explain all of the output but it could be a useful starting point to achieve what you want.



thank you. I had tried qlmanage before posting my question. It only seems to work with images.

Sorry @ronald, but I just did a quick test of it with a PDF and it works OK. See below:

QL 2020-04-09_09-50-01

Using the command

plmanage -m plugins

lists out all the files it works with and on my system it's a very large number! Maybe you're missing something?

Stay safe.

1 Like

Sorry for the delay. I am still working on it, using an excellent reference

I just can't figure out why all I get when I run the terminal command is the image below (using a pdf starting with the word order). The fact that the word order is displayed is proof that the command 'sees' the right file. I am wondering if it could be an issue of catalina terminal config issue in security sys pref ?

No problem. If I run qlmanage slightly differently I get this:

QL 2020-04-09_22-13-51

Which is obviously very different to the example I posted previously.

The difference is, for the one that works, I used:

qlmanage -p "/Users/taj/Downloads/GraphicConverter 11 Manual_GC11_EN.pdf"

but for the one that didn't I used:

qlmanage -p /Users/taj/Downloads/GraphicConverter 11 Manual_GC11_EN.pdf

In other words, I made sure the pathname was enclosed in quotes so that the spaces in the path didn't cause a problem.

As I had some spare time earlier today, I was playing around and created a test macro. Have a look:

QL Test.kmmacros (4.6 KB)

It decides whether it's being called from Finder or somewhere else and then behaves accordingly. It is not a fully working solution but it may give you some ideas to progress towards your own solution.

Hope this helps!

1 Like

thanks very much. i now realize that paths take quotes in shell scripts, which explains everything. And thank you for the macro !

:+1: great