MACRO: Markdown Link Tool, v5.0

Hello @_jims, How are you creating these nice GIF demos? I'm using free LiceCAP, but it doesn't show the keyboard shortcuts ...

1 Like

Iโ€™m curious too how heโ€™s able to screen record the entire screen and not have the file be so large that it canโ€™t be uploaded :sweat_smile:

Hi @ALYB and @cdthomer. Great questions. I wish I had a nice, simple, and fast process I could share, but unfortunately I don't.

Before I get into the specifics, allow me to step back. With macros here (and with iOS shortcuts elsewhere) I've supplemented my forum posts in three ways:

  1. Screenshots

  2. Screencasts uploaded to YouTube and referenced in a post. Some forums allow YouTube embedding, others don't. I can't remember if I've tried embedding on this forum. But I have included links to YouTube videos. Here are two that immediately come to mind:

    a. Log Itโ€”Quickly Save Plain Text Snippets to One or More Log Files : youtu.be/Zp-8BHhxPLY

    b. Augment or Filter Text : https://youtu.be/Yvnwopo6fio

  3. GIF Animations (like above)

As I'm sure you know, screenshots are simple and fast. I'm a Setapp subscriber so I use CleanShot X. When I worked at a F50 company and was forced to use Windows, I used Snagit. There is a version of Snagit for macOS, but I've never tried it.

Also, as I'm sure you know, for screencasts and GIF Animations, the time and effort is a huge step change up. For a few of my macro (and iOS shortcuts) posts, I've spent more time on the screencast than on the macro/shortcut. :frowning:

When I do decide to use a screencast or GIF animation, I start with ScreenFlow. I do some independent consulting and purchased it for that work, so I've been able to absorb the $150 initial cost and $50 upgrade fees.

ScreenFlow is okay, but I'm not a huge fan. It does, however, have a Show Keystrokes feature with two options: 1) Show all keys, 2) Show only modifier keys.

I've found that the Show Keystrokes feature is far from flawless: more than once I've had to repeat a recording session. Also, since keys are never pressed exactly simultaneously, combinations like โŒƒโŒ˜C are normally recorded on the timeline in a sequence something like this:

 โŒƒ ... โŒƒโŒ˜ ... โŒƒโŒ˜ ... โŒƒโŒ˜C ... โŒƒโŒ˜C ... โŒƒโŒ˜C ... โŒƒโŒ˜C ... โŒƒโŒ˜ ... โŒƒโŒ˜ ... โŒ˜ 

Since all sequences except โŒƒโŒ˜C are distracting within screencast, I split the recording into clips and selectively disable Show Keystrokes for the clips that include the subsets of the โŒƒโŒ˜C. (I hope that makes sense.) This process is tedious and IMO the Show Keystrokes feature has some room for improvement (e.g., maybe time thresholds could be added to avoid the key combination subsets).

I've converted some of my shorter MP4 recordings to GIF animations using gifski. To keep the final GIFs small I reduce the frame rate (to a value that still looks decent), but the biggest factor seems to be the recording dimensions. For the GIF above, I set my 16" MBPro to 1152x720 before starting the ScreeFlow recording session.

I hope that helps. This topic probably merits a separate thread as I'm sure others have more insight than me. I'd certainly love to learn about a process that is simpler.

2 Likes


After discussions with @cdthomer, I've updated Markdown Link Tool.

Version 3.2

When potentially updating a configuration file with the Clipboard contents, if a Markdown Link is not found, this macro executes the macro Copy as Markdown Link. This macro can build a Markdown Link to browser pages and elements for many other applications.

1 Like

I've updated the OP with Version 3.3 of Markdown Link Tool:

  • Added several new markdown links to the configuration files. This macro now includes 150+ links.
  • Corrected a few typographical errors within comments and one within a dialog.
  • Updated the information in TESTED WITH.
2 Likes

Hello @_jims @ComplexPoint @cdthomer,

I am very grateful for this macro which I use a lot. I am working on a mind map using Simple Mind.

When I try to copy the markdown link, I see the error message below. How could I write a macro to add simple mind to the library of markdown list macros ?

Thanks very much!

2 Likes

I don't use SimpleMind myself, but looking at the Trial version, I see that its menu paths include:

Edit > Link Topic > Copy Link to Topic

Does that seem to work ? Here, I may have misread its function, or there may be a limitation imposed on the trial.

If that menu path does, in fact, capture a url for a selected node, then you can get the label for a node with a simple Edit > Copy and assemble a submacro, using successive clipboard contents, along the lines of others in:

RobTrew/copy-as-md-link: macOS Keyboard Maestro macro group

but with:

  • the name com.modelmakertools.simplemindosx
  • and code which:
    • just assigns a value to the KM variable mdLink
      (in the form of a [label](url) string)
    • assembled by script or KM blocks in the manner that you will see in other sub-macros in the copy-as-md-link group.

It's not clear to me, however, (after a cursory search) whether SimpleMind actually supports its own url-scheme, and it also looks as if there may be some sandboxing limitations on link-navigation if you have the AppStore version.

See the asterisked footnote at the bottom of:

Navigation link (to a file, topic, contact or the web) - SimpleMind

https://simplemind.eu/faq/navigation-link/

2 Likes

OK. All clear. thanks very much !

I've updated the OP with Version 4.0 of Markdown Link Tool:

  • When ๐— ๐—ฎ๐—ป๐—ฎ๐—ด๐—ฒ ๐—Ÿ๐—ถ๐—ป๐—ธ๐˜€ is selected, if the clipboard contains a URL, a dialog will appear that provides an option to create and save a Markdown link. See the HOT KEY TRIGGER section above for more information.

  • When managing links, added a dialog option to skip the addition of a new link.

  • When markdown links are prepended, they are now placed below the comments at the beginning of the text files. Now using the native Write To File action, thus if KM v8.1+, the previous version of the text file will be moved to the Trash.

  • If using KM v10.2+, when markdown links are appended, using the native Append Text To File since the read-only issue has been addressed. See the comments below for more information. Also, since this native action is being used, the previous version of the text file will be moved to the Trash.

  • If using KM v10.2+, removed the Prompt With List default value (all:).

  • Fixed bugs related to the HTML, Bracketed URL, or Plain URL formats.

  • Moved the Clipboard restoration logic and CancelJustThisMacro to a single location.

  • Added several new markdown links to the configuration files. This macro now includes 160+ links.

  • Updated the information in TESTED WITH.

4 Likes

I've updated the OP with Version 4.1 of Markdown Link Tool:

  • Clipboard restoration is now properly handled when the Clipboard is initially empty.

  • Deleted a few duplicate entries in 0 Favorites.md, 8 Keyboard Maestro Forum.md, and 9 Keyboard Maestro.md.

I've updated the OP with Version 5.0 of Markdown Link Tool:

  • In the link management section of the macro, if the Clipboard includes a URL two dialog options were added: Skip and Clear CB and Skip. When either option is selected, the macro continues and spawns Copy as Markdown Link, a macro by @ComplexPoint to potentially create a Markdown Link from the current application context. Previous versions only included two options: OK (to process the Clipboard URL) and Skip (to open the link files folder). In this version, the previous Skip button has been changed to Folder.

  • Improved error checking and more information to the dialogs that appear during analysis of URLs/Markdown Links found in the Clipboard or created by Copy as Markdown Link.

  • Improved the readability of the main Prompt With Lists by adding :point_right:t6: to the entries that contain information regarding alternative actions that can be summoned using modifier keys.

  • Improved readability of the Prompt With List used to select the mode for updating links files.

  • the CSS Style generation, by moving style comments to a Comment action above local_Style.

  • Changed from AppleScript to Set Variable to Text to delete the global variables used in the JXA that creates the two-variant clipboard.

  • Changed the settings to use local variables. Previously global variables were used and the values were then copied to local variables. (This seemed like a good idea, but it really added unnecessary complication.)

  • Streamlined some of the macro logic.

  • Added several new markdown links to the configuration files. This macro now includes 175+ links.

  • Updated the information in TESTED WITH.


By default, this macro includes 175+ Markdown links segregated into three text files:

  • 0 Favorites.md

  • 8 Keyboard Maestro Forum.md

  • 9 Keyboard Maestro.md.

The integer prefix is included to set the order that the links are presented. The text files are stored in a folder defined within the macro. Text files can be added, deleted, and, of course modified.

The macro begins by displaying the list of stored Markdown Links...

The top entry in the above list is informational:

:point_right:t6: Selected link will be ๐—ฃ๐—ฎ๐˜€๐˜๐—ฒ๐—ฑ -or- โ‡ง:๐—ข๐—ฝ๐—ฒ๐—ป; โŒฅ:๐—–๐—น๐—ถ๐—ฝ๐—ฏ๐—ผ๐—ฎ๐—ฟ๐—ฑ; โŒฅโ‡ง:๐—”๐—น๐˜๐—ฒ๐—ฟ๐—ป๐—ฎ๐˜๐—ฒ ๐—™๐—ผ๐—ฟ๐—บ; โŒƒโ‡ง:๐— ๐—ฎ๐—ป๐—ฎ๐—ด๐—ฒ ๐—Ÿ๐—ถ๐—ป๐—ธ๐˜€


Markdown Links in the Clipboard or from the current application context* can be added two ways:

  1. From the above list โŒƒโ‡ง:๐— ๐—ฎ๐—ป๐—ฎ๐—ด๐—ฒ ๐—Ÿ๐—ถ๐—ป๐—ธ๐˜€ is selected, i.e., โŒƒโ‡ง are down when return is pressed.
  2. The macro is launched with a trigger that includes the Control key (โŒƒ).

* This feature is provided by spawning the excellent macro Copy as Markdown Link by @ComplexPoint.


New Markdown Links can be added in a variety of ways using the options in this list.

Typically I'll append links to one of the three files and later come back with a text editor and move the links into a section that is appropriate.


If the first item in the above list is selected, the folder that contains the links will be opened in the Finder. Note that I have chosen to store my links in an iCloud Drive folder. Any files in this folder that include an md extension will be used by this macro.

2 Likes