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.
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.
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
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
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)
CONFIGURATION / INSTALLATION
this script requires AutoHotkey UNICODE to be installed.
It relies on the following libs :
- Winclip by Deo http://www.apathysoftworks.com/ahk/index.html with the UTF8 mod from https://www.autohotkey.com/boards/viewtopic.php?f=6&t=29314&start=20#topahk%20strput
- CreateFormData.ahk by tmplinshi + mod by SKAN https://www.autohotkey.com/boards/viewtopic.php?p=85687#p85687
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
- 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.
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.