Use Case:
- When you need a linked reference to a KM Wiki article, like responding to questions in this KM Forum, you can use this macro which makes it very easy to search and find the correct article, create a markdown link, and then paste into your reply to the question.
UPDATED: 2020-10-03 17:32 GMT-5
- Fix issues due to changes in HTML make by Google
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
MACRO: KM Wiki -- Google Search and Return Markdown Link in Forum Post @KMF
-~~~ VER: 3.0 2020-10-03 ~~~
Requires: KM 8.2.4+ macOS 10.11 (El Capitan)+
(Macro was written & tested using KM 9.0+ on macOS 10.14.5 (Mojave))
DOWNLOAD Macro File:
KM Wiki -- Google Search and Return Markdown Link in Forum Post @KMF.kmmacros
Note: This Macro was uploaded in a DISABLED state. You must enable before it can be triggered.
Example Workflow/Output
This whole process takes < 30 seconds, in most cases.
1. Start in Reply to Forum Post
2. Enter/Select Search Terms
Type Search Terms
OR, Pick from List with Autocomplete
3. Choose Link by Number from Search Results
4. Choose KM Wiki Article & Return
Close Tabs Added in this workflow
5. Paste Markdown Link into Forum Post
ReleaseNotes
Author.@JMichaelTX
PURPOSE:
-
Make it Easy to Find and Get MD Link to KM Wiki Articles
(most often used in the KM Forum when answering questions).- Works in Either Safari or Chrome (tested in both)
HOW TO USE:
- Create a Forum Reply (or new Topic)
- Optionally Select Text as KM Wiki Keyword
- Trigger this macro
- IF you Selected text,
- it will set the Wiki Search Term to that selected text
- ELSE, you will be prompted to enter or select terms from a list
- Do a Google Site Search using those terms
- Script will Number Google Search Results
- Enter Link# on Results Page to open that Wiki Article
OR
Press ESC to CANCEL Macro. - Macro will prompt you for the type of return:
- Markdown Link (default button)
- Text of Web Page
- URL of Web Page
- Check the box for "Set to Clipboard ONLY" to set the clipboard, and NOT paste results.
- If you want to goto another Wiki page, do so manually, and when ready,
click on the "Rescan" button to scan that page in update the KM Prompt. - Click any button (other than "Cancel") to return to your Forum Post and the results will be pasted into the Forum Post.
MACRO SETUP
-
Carefully review the Release Notes and the Macro Actions
- Make sure you understand what the Macro will do.
- You are responsible for running the Macro, not me.
.
- Assign a Trigger to this maro. I prefer ⌃⇧K
- Move this macro to a Macro Group that is only Active when you need this Macro. I prefer "Browsers"
- Enable this Macro (if needed).
- You MUST have enabled/checked "Allow JavaScript from Apple Events" in Safari and Chrome.
. -
REVIEW/CHANGE THE FOLLOWING MACRO ACTIONS:
(all shown in the magneta color)- SET Search URL to Your Preferred Search Provider
- Default is Google.
- SET List of Wiki Search Terms
- Default is list of sections from the KM Home Page
- SET Search URL to Your Preferred Search Provider
REQUIRES:
- Keyboard Maestro 8.2.3+
- macOS Yosemite 10.11.3+
- Either Safari or Chrome
- You MUST have enabled/checked "Allow JavaScript from Apple Events" in Safari and Chrome.
USER SETTINGS:
- Any Action in magenta color is designed to be changed by end-user
ACTION COLOR CODES
- To facilitate the reading, customizing, and maintenance of this macro,
key Actions are colored as follows: - GREEN -- Key Comments designed to highlight main sections of macro
- MAGENTA -- Actions designed to be customized by user
- YELLOW -- Primary Actions (usually the main purpose of the macro)
- ORANGE -- Actions that permanently destroy Varibles or Clipboards,
OR IF/THEN and PAUSE Actions
REQUIRES:
- Keyboard Maestro Ver 7.3+ (don't even ask me about KM 6 support).
- El Capitan 10.11.6+
- It make work with Yosemite, but I make no guarantees.
USE AT YOUR OWN RISK
- While I have given this limited testing, and to the best of my knowledge will do no hard, I cannot guarantee it.
- If you have any doubts or questions:
- Ask first
- Turn on the KM Debugger from the KM Status Menu, and step through the macro, making sure you understand what it is doing with each Action.