QuickSNIPP transcluder / webclipper / scratchpad aio ahk script

a while ago I posted a small autohotkey utlity to facilitate ‘block referencing’ by extracting text and returning a transclusion link.

I’ve been expanding its features and using it for a while to grab text, snippets and web pages, so I guess it might be useful for other obsidianers too… at least if you’re not afraid to use a script made by an art guy rather than a proper dev. Similar tools are listed at the end of this post, check them out.

Obsdn-QuickSNIPP

a companion ahk script for my Obsidian theme to make transclusions from text blocks, save web snippets and take quick notes.
Don’t mind the silly names, it’s just one script that deals with 3 workflows.

DESCRIPTION

WebSNIPP WebClipper

CTRL ALT C copy selected HTML to the clipboard as markdown

CTRL ALT X save selected HTML as a md file, and get the transclusion link in obsidian format

CTRL F9 save current webpage as a md file via the fuckyeahmarkdown.com API, and get the transclusion link in obsidian format. It’s slow and sends keyboard shortcuts, so it’s not highly reliable but works if you wait a bit. Tested on FF, Chrome, Brave , Maxthon

QuickSNIPP Scratchpad

CAPS LOCK x2 display a scratchpad floating window (can remains always on top) to write quick notes whil using a browser or any other app. Save the notes as snippets and get the transclusion link. Hide the scratchpad with ESC or click on the X button.

AutoSNIPP Transcluder

CTRL SHIFT X extract the selected text as a new file, get the transclusion link = INSTANCES or BLOCK REFERENCE for poor people

CTRL SHIFT C extract the selected text as a file, then get the transclusion link = CLONING blocks (since the new block is a copy, it can be modified independently, without modifying the original paragraph, whereas editing one instance would modify all instances, hence CTRL SHIFT C vs CTRL SHIFT X)

VIDEO DEMO

CONFIGURATION / INSTALLATION

this script requires AutoHotkey UNICODE to be installed.
It relies on the following libs :

Before first use, edit the .ahk file with a text editor to change the default configuration
search for ‘CONFIG’ and modify :

  • the path to the include libs
  • the location to save the snippets in your obisidan vault
  • optionally, tweak the naming convention for the generated snippets
  • optionally, modify the macro shortcuts

the script is free to share and modify. Please reshare/make a pull request if you improve it.

SCREENSHOTS

transcluder demo

if you don’t need the web clipper & scratchpad, I’ve also updated Obsdn-AutoSnipp.ahk to make a version for autohotkey Unicode & Ansi.
The main difference : Quicksnipp can grab HTML and convert it to markdwown, while AutoSnipp will copy/save PLAIN TEXT only.

Obsdn-AutoSnipp.ahk can be useful in conjunction with other webclippers like MarkDownload or Roam Highlighter to auto-save the clips in the vault and get the transclusion link.

For instance,with MarkDownload, once the page has been converted to markdown, instead of clicking download (to save a local file in the browser’s download folder), use Obsdn-AutoSnipp (CTRL-SHIFT-C) to automatically create a md file in your vault. The link to the file will be in the clipboard (in transclusion format).

Also check out those links of interest, they are probably cleaner and more optimized than my scripts-by-not-a-coder hacks :

MarkDownload MarkDownload - Markdown Web Clipper
RoamHighlighter Web Clipper/Highlighter and Kindle highlights/notes extraction Extension
TranscludeMe Transclude Me (KM macro on OSX)
How do I get content from websites into my notes?

ending the wall of text here.

10 Likes

Wow, looks impressing! Thank you for your work!