DNtp+Alfred workflow to attach notes in markdown to PDFs

I’ve just finished a workflow to aid my research. It uses Alfred and AppleScript to provide shortcuts for creating and associating a markdown file with a PDF. I’ve taken some steps to avoid cluttering the place up; the notes are created in a subgroup. One note of warning: it uses the URL attribute to make the PDF → markdown association; so, if you are already using the URL attribute, be warned, it will blow it away. It also provides shortcuts to specialised viewers (which you should change/delete or ignore :wink:) and accessing the note. Here is the link:

https://github.com/shazoom/Banana_DNtp

If you don’t use Alfred but KM, Launchbar or something else you could modify it without too much difficulty. All the logic is in AppleScript. The workflow itself is just a zip archive so it should be easy to take a look at what it does.

Interesting and useful. Thanks for contributing your work!

This fails with an Alfred error “select PDF: receipt markdown” – which is too obscure to be useful. I suggest the workflow might need some debugging.

Over here “dme” performs no action – I would expect it to open my macOS-configured default markdown editor, SublimeTest. Perhaps some instruction is needed for configuration?

I also found that the keywords conflict with others that Alfred knows about, so users might be advised to modify the keywords before using the work flow.

Thankyou for taking the time to look at it:

and thank you for the feedback too.

This error indicates that you don’t have a PDF file selected but should. I believe the logic is correct for this.

Hmmmm, I’m not sure I mentioned this (there is a lot going on here :wink: ), the actions—all but dn— have an Arg and Var which adds environment variables for the viewer, file type and file extension so the script know what it should be doing. You will need to modify the viewer for something sane on your system. The script will use something like```

do shell command “open -a “$viewer”…”

[quote]
Over here "dme" performs no action -- I would expect it to open my macOS-configured default markdown editor, SublimeTest. Perhaps some instruction is needed for configuration?
[/quote]
I'll make it use the system default viewer, rather than specifying, as [i]dn[/i] does. It requires an extra check but it should be simple enough.
[quote]
I also found that the keywords conflict with others that Alfred knows about, so users might be advised to modify the keywords before using the work flow.
[/quote]
Oh, well I'll let users change the keywords for themselves if there are conflicts.

I’ve changed a couple of things: use default applications for dp (PDF) and dm (markdown), improved the error message when the wrong file type is selected and added a bunch do notes and a bit more to the “About this workflow”.

Nothing very big but should be a lot easier to work out how to use and alter it.

Em, yes, I did grasp that concept. The error appears when the PDF is selected. Over here.

Sorry, didn’t mean to be condescending, but I’d need more to go on if I can figure out why you’re seeing this as a problem. Would you be able to copy the record into an empty database, confirm the behaviour is still borked, and send me a copy of the DB; it seems like the easiest way for me to reproduce the issue.

This error message:

should only happen if the type is wrong in DNtp, if it fails this check:


if kind of mSelection = "PDF+Text" then

That would suggest that the record doesn’t have the correct type :neutral_face: