Last active
October 19, 2022 12:35
-
-
Save oblinger/742c5b1b3b99ad020f0c301abdc62811 to your computer and use it in GitHub Desktop.
Obsidian URL link capture from Browser (using MacOS and Keyboard Maestro)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<array> | |
<dict> | |
<key>Activate</key> | |
<string>Normal</string> | |
<key>CreationDate</key> | |
<real>527661851.80467802</real> | |
<key>Macros</key> | |
<array> | |
<dict> | |
<key>Actions</key> | |
<array> | |
<dict> | |
<key>ActionUID</key> | |
<integer>54418</integer> | |
<key>KeyCode</key> | |
<integer>8</integer> | |
<key>MacroActionType</key> | |
<string>SimulateKeystroke</string> | |
<key>Modifiers</key> | |
<integer>256</integer> | |
<key>ReleaseAll</key> | |
<false/> | |
<key>TargetApplication</key> | |
<dict/> | |
<key>TargetingType</key> | |
<string>Front</string> | |
</dict> | |
<dict> | |
<key>ActionUID</key> | |
<integer>54419</integer> | |
<key>Conditions</key> | |
<dict> | |
<key>ConditionList</key> | |
<array> | |
<dict> | |
<key>ClipboardConditionType</key> | |
<string>Is</string> | |
<key>ClipboardText</key> | |
<string></string> | |
<key>ConditionType</key> | |
<string>Clipboard</string> | |
</dict> | |
</array> | |
<key>ConditionListMatch</key> | |
<string>All</string> | |
</dict> | |
<key>ElseActions</key> | |
<array> | |
<dict> | |
<key>ActionUID</key> | |
<integer>54421</integer> | |
<key>MacroActionType</key> | |
<string>SetVariableToText</string> | |
<key>Text</key> | |
<string>%SystemClipboard%</string> | |
<key>Variable</key> | |
<string>title</string> | |
</dict> | |
<dict> | |
<key>ActionUID</key> | |
<integer>54422</integer> | |
<key>MacroActionType</key> | |
<string>SetVariableToText</string> | |
<key>Text</key> | |
<string></string> | |
<key>Variable</key> | |
<string>notes</string> | |
</dict> | |
</array> | |
<key>MacroActionType</key> | |
<string>IfThenElse</string> | |
<key>ThenActions</key> | |
<array> | |
<dict> | |
<key>ActionUID</key> | |
<integer>54420</integer> | |
<key>Buttons</key> | |
<array> | |
<dict> | |
<key>Button</key> | |
<string>OK</string> | |
</dict> | |
<dict> | |
<key>Button</key> | |
<string>Cancel</string> | |
<key>Cancel</key> | |
<true/> | |
</dict> | |
</array> | |
<key>MacroActionType</key> | |
<string>PromptForUserInput</string> | |
<key>Prompt</key> | |
<string>Please enter the details for these variables.</string> | |
<key>TimeOutAbortsMacro</key> | |
<true/> | |
<key>Title</key> | |
<string>Enter URL link title</string> | |
<key>Variables</key> | |
<array> | |
<dict> | |
<key>Default</key> | |
<string></string> | |
<key>Type</key> | |
<string>Automatic</string> | |
<key>Variable</key> | |
<string>title</string> | |
</dict> | |
<dict> | |
<key>Default</key> | |
<string></string> | |
<key>Type</key> | |
<string>Automatic</string> | |
<key>Variable</key> | |
<string>notes</string> | |
</dict> | |
</array> | |
</dict> | |
</array> | |
<key>TimeOutAbortsMacro</key> | |
<true/> | |
</dict> | |
<dict> | |
<key>ActionUID</key> | |
<integer>54423</integer> | |
<key>AllWindows</key> | |
<true/> | |
<key>AlreadyActivatedActionType</key> | |
<string>Normal</string> | |
<key>Application</key> | |
<dict> | |
<key>BundleIdentifier</key> | |
<string>md.obsidian</string> | |
<key>Name</key> | |
<string>Obsidian</string> | |
<key>NewFile</key> | |
<string>/Applications/Obsidian.app</string> | |
</dict> | |
<key>MacroActionType</key> | |
<string>ActivateApplication</string> | |
<key>ReopenWindows</key> | |
<false/> | |
<key>TimeOutAbortsMacro</key> | |
<true/> | |
</dict> | |
<dict> | |
<key>ActionUID</key> | |
<integer>54424</integer> | |
<key>MacroActionType</key> | |
<string>Pause</string> | |
<key>Time</key> | |
<string>.5</string> | |
<key>TimeOutAbortsMacro</key> | |
<true/> | |
</dict> | |
<dict> | |
<key>Action</key> | |
<string>ByTyping</string> | |
<key>ActionUID</key> | |
<integer>54425</integer> | |
<key>MacroActionType</key> | |
<string>InsertText</string> | |
<key>TargetApplication</key> | |
<dict/> | |
<key>TargetingType</key> | |
<string>Front</string> | |
<key>Text</key> | |
<string> [%title%](%SafariURL%) %Variable%notes% | |
</string> | |
</dict> | |
<dict> | |
<key>ActionUID</key> | |
<integer>54426</integer> | |
<key>MacroActionType</key> | |
<string>Pause</string> | |
<key>Time</key> | |
<string>.4</string> | |
<key>TimeOutAbortsMacro</key> | |
<true/> | |
</dict> | |
<dict> | |
<key>ActionUID</key> | |
<integer>54427</integer> | |
<key>AllWindows</key> | |
<true/> | |
<key>AlreadyActivatedActionType</key> | |
<string>Normal</string> | |
<key>Application</key> | |
<dict> | |
<key>BundleIdentifier</key> | |
<string>com.apple.Safari</string> | |
<key>Name</key> | |
<string>Safari</string> | |
<key>NewFile</key> | |
<string>/Applications/Safari.app</string> | |
</dict> | |
<key>MacroActionType</key> | |
<string>ActivateApplication</string> | |
<key>ReopenWindows</key> | |
<false/> | |
<key>TimeOutAbortsMacro</key> | |
<true/> | |
</dict> | |
<dict> | |
<key>ActionUID</key> | |
<integer>54428</integer> | |
<key>JustDisplay</key> | |
<false/> | |
<key>MacroActionType</key> | |
<string>SetClipboardToText</string> | |
<key>Text</key> | |
<string></string> | |
</dict> | |
</array> | |
<key>CreationDate</key> | |
<real>669413915.73626196</real> | |
<key>IsActive</key> | |
<false/> | |
<key>ModificationDate</key> | |
<real>669422341.47502303</real> | |
<key>Name</key> | |
<string>HYPER-L Insert Obsidian web LINK from Safari</string> | |
<key>Triggers</key> | |
<array> | |
<dict> | |
<key>FireType</key> | |
<string>Pressed</string> | |
<key>KeyCode</key> | |
<integer>37</integer> | |
<key>MacroTriggerType</key> | |
<string>HotKey</string> | |
<key>Modifiers</key> | |
<integer>6400</integer> | |
</dict> | |
</array> | |
<key>UID</key> | |
<string>EE73489E-7206-4F81-90E6-4FB5D473815C</string> | |
</dict> | |
</array> | |
<key>Name</key> | |
<string>Global Macro Group</string> | |
<key>ToggleMacroUID</key> | |
<string>2464877A-5E7F-4E41-A46D-3A4D6062E77B</string> | |
<key>UID</key> | |
<string>169235E5-ECCC-4FE6-80B5-65FC9566BBD8</string> | |
</dict> | |
</array> | |
</plist> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Grabbing multiple URLs from my web browser into markdown involved tedious back and forth flipping between two apps. This sucks since I often like to use markdown to record some info exploration, since I can easily include commentary with the links.
I called this "hyper optimized" since one could save 10 web tabs with 20 key strokes, and ten text selections in order to pick the ten titles for the links. I don't know of any other method as streamlined.
Here are the detailed mechanics:
SETUP: The macro assumes the obsidian's cursor is at a good place for the next URL like to be added (though the window need not be in focus). It assumes the web browser it open to the URL to be captured.
TRIGGER: The user hits control-opt-command L to capture.
TITLE: If there is an active selection then it is copied and used as the title of the markdown link (often there is good text on the page to use as a title). Otherwise the user is prompted for a title, and some optional notes to append after the link.
FLIP-FLIP: The macro then focus onto Obsidian, posts the link and notes, pauses for a moment so you can see what you just did to your Obsidian document, then it flips back to the browser. There you can close that tab, and you are ready to capture your next link whenever you find it.
It is a super simple macro, but it is an ABSOLUTE JOY to use if you like to capture notes on your web explorations... getting rid of a tedious bit of hoo-haa. Included here is the macro, you can upload if you like it. I also included screen shots if you prefer to just manually create the macro... since it is pretty short. If you use Chrome instead of safari, then just replace %SafariURL% with %ChromeURL%
Cheers,
Dan
Here is the macro shown visually if you want to just manually add it: