Best Examples of Keyboard Maestro Macros


MODERATOR'S NOTE 2022/10/12 21:13 DST

See More Recent Topic: Best Macro List


Best Examples of Keyboard Maestro Macros

Hey guys, I'd like to build a wiki page that lists the best examples of Keyboard Maestro Macros.

ATTENTION Readers: Click here to jump to some actual macros in this topic.

If you have a macro you think should be included in the "best examples", please post here with a brief description (including why you think it is a "best"), and a link to the actual macro.

"Best" is a very subjective term, but I'd like to define it as one or more of the following:

  • Examples that are likely to have broad appeal, likely to be used by many users
  • Show automation of widely used apps
  • Show automation of very complex processes, not likely to be automated otherwise
  • Show ease-of-use of automating simple procedures that are highly repetitive
  • Show edge cases that demonstrate the breadth of Keyboard Maestro
  • Show automation that can be easily done by non-programmers
  • Show automation that would appeal to power users
  • others?

This list is just off the top of my head. I'm sure that @peternlewis, @ccstone, @ComplexPoint, and others will have thoughts on the criteria for what is the "best". Of course, @peternlewis, if you have a list that you would prefer to be used, we can certainly go with that.

Why am I asking?

I am a huge fan/user of Keyboard Maestro, and I like to share info about it with my friends and colleagues, and fellow Internet users. But I have a hard time succinctly stating "What is Keyboard Maestro?". So, I'm working on a little script I can use, and maybe put in the Keyboard Maestro Wiki if Peter approves. I'd like to include some great examples of KM macros.

BTW, I've reviewed the KM Wiki, Documentation, Home page, and elsewhere, and I have not been able to find something succinct that clearly communicates to people who know little or nothing about KM. Maybe I've missed it. If so, I apologize, and request that you post the link to it.

Many thanks to all that contribute!

16 Likes

Hey JM,

It's shocking that people don't get things that are obvious to me.   :smiley:

(Of course I don't much care for it when I'm on the other side of the equation.)

QuicKeys became available a year or two after the Mac debuted – and turned a useless chunk of circuits into a working machine (once upgraded to a MacPlus).

When TypeIt4Me came out more than 20 years ago I tested it for 3 days and bought a copy – what a no-brainer.

I tell people and tell people about the advantages of things, and they don't want to know.

However. When I show them they sometimes see the light.

Years ago I installed a bunch of my utilities on a client's system, so she could try them.

Two weeks later she said: “I can't believe I've used a Mac all this time without this functionality!”

Then she bought copies of the utilities.

(I had shown her how easily I got things done with these utilities in the past, but it wasn't until she actually used them herself for a little while that she saw the light.)

So – while I think this task is worthwhile, I also think a few well done videos would be a great idea.

I have meant to work on this, but other things have kept me busy.

-Chris

2 Likes

Hey Chris, "great minds . . ." and all that. :wink:
What's the old saying? "A picture (or video) is worth . . ."

Years ago, back in my NASA days, I learned this:
Different people assimilate new information in different ways:

  • Visually (photos/videos)
  • Reading
  • Presentation

Some require one way, some all ways before they really get it.
I had a few top-level execs that didn't get it (or perhaps accept it) until I sat down with them on a one-on-one basis.
Still true today with my clients.

So, for a broad audience, you have to provide all ways, and usually multiple times.

Personally, I like videos (documentaries), backed up by solid electronic documents, with plenty of reference links.

1 Like

Also an interesting thing to note is speed of delivery with all three. Example: I use an app called "MySpeed" by Enounce. I find with some material if I speed up the playback of the video where the speaker is talking faster, I understand it better. In other cases, I slow down a speaker that I am having trouble understanding or visualizing the concept they are explaining. There is a similar effect with musical phrases where if you slow down a phrase too slow it doesn't make sense and is not memorable. There are also studies on reading material on different colors of paper. e.g. someone who had trouble understanding a story was given the same story on green paper or blue paper and it was found to improve their comprehension. Interesting stuff for sure.

MySpeed is great because it allows me to take really good material that is presented by a slow and/or boring speaker and jack it up to a speed where it's more interesting to listen to.

Now to your comment about videos. Yes it would be great. I had a difficult time finding some at first.

It's topics like this that make me wish that YouTube had an extra button under videos to go with the thumb up and thumb down to express like or dislike. I think they should add a Circle with a slash button that means "This video is so horrible that it must be pulled by YouTube promptly and if you happen to land on it, turn around and go back the way you came because you will be wasting your time here. :wink:

I jest.

1 Like

OK guys, please give us some examples!
I'll start:

PURPOSE: Demo How to Select, Read, and Process each line in a file

I think this is a really good example because:

  1. It's likely to be a common need
  2. It is simple, yet powerful
  3. It is not too difficult to understand
  4. It demonstrates several great tools in KM:
  • The For Each action, which can be hard to understand at first
  • Use of a simple AppleScript
  • Reading Files
  • Displaying results of the Actions.
  1. It is a "ready to use" macro, that requires minimal effort on the users part to customize.

I think it could be a good tutorial with the right text/words, maybe even a video.

3 Likes

Well, this is only somewhat curated, and not documented, but this is my Examples Macro Group which has been collected over many years. Some of them may be old enough that they are no longer good examples, or solve problems that no longer exist.

Examples Macro File.kmmacros (379.8 KB)

It contains the following examples:

  • A Timer Example
  • Add 5 Seconds to to HH:MM:SS time
  • Add to HH:MM time
  • Append Selection to BBEdit Scratchpad
  • Bring Largest Window to Front
  • can't
  • can't2
  • Capture All Screens
  • Check For Password in Plain Text Fields
  • Click and Drag Back
  • Close Tab (with Safety)
  • Control Typing Speed
  • Convert to JPEG
  • Create Link
  • Date Addition
  • Date of Last Friday
  • Display as Currency
  • Display as Currency v6
  • Display Current Mouse Position
  • Display Large Text
  • Double Tap Control
  • Draw a Face
  • Draw a Smiley
  • Draw Circle
  • Draw Template
  • DropBox { Toggle }
  • Execute Shell Script without Waiting
  • Find Last Added
  • Find Latest File
  • Find Matching File
  • Finder Find by Name
  • Finder Hide Hidden Files
  • Finder Selection Bug
  • Finder Show Hidden Files
  • Fix 12 Hour Date in 24 Hour Locales
  • Fix Mail Missing Cursor
  • Fix TWo
  • Fix TWo
  • Form Example 1
  • Form Example 2
  • Get Multiple Results from Execute JavaScript
  • Get Telstra Bill
  • Highlight Mouse
  • Indirect Variable Access
  • Insert Numbered List
  • Iterate Through List
  • JavaScript for Automation
  • Lookup Name
  • Make Styled Text from Clipboard
  • Month From List
  • Move Selected Files to Desktop
  • Move Window while Command Key is Down
  • Once Per Day
  • Open Downloaded PDFs in Preview
  • Parsing/Formatting Dates
  • Password Display
  • Password Store
  • Periodic Screenshots
  • Print to PDF in Mail
  • Prompt For User Input
  • Read a Random Line from a File
  • Really Quit?
  • Red Strikethrough
  • RegEx Typed String
  • Reminder
  • Rename Files to Creation Date
  • Rename Selected Files With Date
  • Replace Placeholder
  • Resize Proportionately
  • Resize Selected Images
  • Save screenshot if notification pops up
  • Say Hello on Login
  • Select Font in Pages
  • Select Name From List
  • Set Action Delay Example
  • Set Finder Files Labeled Red
  • Set Network Location to Home
  • Set Network Location to Work
  • Share Finder Selection to Dropbox Public
  • Slow Typing
  • Smart French Quotes
  • Smart Quotes
  • Speak Numbers
  • Tag Selected Files Red
  • Timer via Trigger Macro by Name
  • Toggle Finder Show All Files
  • Toggle Firewall
  • Translation Mapping
  • TypedString before&after word break
  • Variable Repeat
  • Web Login
  • Web Login Basic
  • Web Login With Keychain
  • Web Page Contains
8 Likes

Thanks for your list, Peter.

I haven't had a chance to look at these yet (but I will), but may I suggest the following:

  • Pick your top 5
  • Categorize the list so the new user (or potential user) is not overwhelmed.

Here's a thought: Is it possible to create a wizard that walks the user through building/selecting a macro?

  • This would deal with the user who just doesn't know how to get started.
  • One of the real strengths of KM, lots of Actions, is also a barrier to new users -- they don't know what they need, or what it is called by KM
  • It would help familiarize the user with the actions

Hey JM,

This is a list of stuff I’ve thrown into my example group. Nothing has been prepared for public consumption, so I won’t post the macros at this time — but If you see something you want to look at let me know.

-Chris


  • ACME Telephone Number Look-Up
  • ACME Telephone Number Look-Up v1.1
  • Activate an Application
  • Activate Default HTTP Helper-App
  • Add Prefix to Text on Clipboard
  • AirPort { Toggle On/Off }
  • Amazon Log-In
  • Append Text to a file with Find/Replace on the Clipboard
  • Append to Text File » Safari Selection, Title, & URL
  • Append to the Clipboard
  • AppleScript with KM-Path-Parameter
  • Array { Get Value using a Regular Expression }
  • Arrays { Display Value & Click at Cooerdinates }
  • Bruce Jackson » Labels & Addresses Demo
  • Calculate Specific Date in Seconds
  • Calculation Example → Time()
  • Cancel on Error Example
  • Change Case { Uppercase }
  • Click Found Image
  • Click the first Web element that matches an XPath
  • Clipboard { Paste Sequentially from History }
  • Convert FURLs on the Clipboard to Posix Paths
  • Copy as quote from Papers.app
  • Creating New Variables on the Fly
  • Custom HTML Prompt
  • Date/Time { ICU Construct }
  • Day One { New Note with Creation Date } { Troubleshooting Version }
  • Delete Duplicate Lines using the Shell
  • Delete Files Containing { Strings } from a Specific Folder
  • Discover Front Application
  • Display Current Mouse Position { Philippe Martin }
  • Display Text in Window
  • Download CSV Data and Open File in Excel Using Bash v0.1
  • Download CSV Data and Open File in Excel Using Bash v0.2
  • Download File to New Dated Directory
  • Download Google Spreadsheet and Open in Excel
  • Dropbox Path plus Sub-Path
  • Dynamically Created User Input List
  • Evernote { Massage Title of Selected Note }
  • Excel → Import CSV Data
  • Excel Brute Force Import
  • Expanding Home Path from KM Variable
  • Extract Email Addresses from Safari
  • Extract Market Value from Selected Email v1.0
  • Extract Market Value from Selected Email v1.01
  • File { Copy IF file size of Source > Destination }
  • Files { Select in Front Window } { KM Version }
  • Find and Copy Files { Recursive }
  • Find and Replace Selected Word in Clipboard
  • Find Files in Front Window { Finder Insertion Location }
  • Find First Image
  • Find First Instance of File with in
  • Find Image on Screen
  • Find Image on Screen (and/or Click)
  • Finder { Resize Name Column using System Events }
  • Finder → Rename and Sequentially Number Selected Items
  • Finder-Selection { Display Paths Briefly }
  • Finder-Selection { Set Tags of Selected Items to Red }
  • Folder Watcher
  • Generate and Paste Email Salutation
  • Get Most Recent File Added to the Documents Folder
  • Google Chrome » Send Tab to OneTab
  • Google Links to TextWrangler
  • Google Search with Clipboard & Encode Entities
  • Google Translate via Python Script
  • Highlight Target or Oval or Rectangle
  • If Files Exist… Then…
  • Insert Dates into Confluence v1.0
  • Insert Dates into Confluence v1.1
  • Insert Last Word of Sentence at Cursor Position
  • Iterate Through Lines in a File
  • Kill & Restart the Selected App
  • Links { Load URL from TextWrangler Front Window }
  • Lookup Email Address
  • Lookup Email Address v0.02
  • Mail » Mark as NOT-Junk and Move to InBox
  • Match URLs with Perl ; Open in Safari
  • Meta-Data Report { mdls }
  • Microsoft Outlook » Extract Email Subject and Replace in Template
  • Move and Resize Front Window
  • Multi-Line Dialog using AppleScript
  • New Mail Message with Embedded Safari Link
  • New Mail Message with Embedded Safari Link {SEV}
  • nvALT { Create New Note }
  • Of Results and Notifications
  • OmniFocus Launcher for Vlad
  • Open Downloaded PDFs in Preview
  • Open or Switch to CafeTran
  • Open Sound Preferences
  • Open URL
  • Open_Wiki_Search
  • Paste User Input into TextEdit
  • Path Finder » Set Tags of Selected Items to Red
  • Path Finder » Set Tags of Selected Items to Red copy
  • Pause with Variable
  • Reformat Text
  • RegEx { Capture Groups with Display to Visualize Them }
  • RegEx { Copy; Find & Replace the Clipboard; Display Text }
  • RegEx { Copy; Find & Replace the Clipboard; Paste }
  • RegEx { Find & Replace in Variable }
  • RegEx { Find Pattern in Lines }
  • RegEx { Find Substrings } 01
  • RegEx { Find Substrings } 02
  • RegEx { Find Substrings } 03
  • RegEx { Find/Replace Clipboard with User-Prompt for Pattern }
  • RegEx { Gather 4 Paragraphs into 4 Variables }
  • RegEx → Find Enumerated Instance of CSV
  • RegEx to Split String into Variables
  • Regular Expression » Keyboard Maestro » Find in Lines
  • Remove Duplicate Lines { Perl }
  • Replace 2 Spaces with 1 Space { Octal }
  • Right-Click at Cursor Position
  • Safari » If Text is Found in Front Page Then…
  • Safari Log-In » brighthouse.com
  • Safari Page Text to TextWrangler
  • Safari Text to TextWrangler
  • Safari Text to TextWrangler with Processing
  • Search the Web
  • Sentence Case
  • Set Front App via Name Matching
  • Set Keyboard Maestro Variables en mas
  • Set Named Clipboard to Syled-Text
  • Shell » Run Perl on the Clipboard
  • Shell: Echo to Floating Window
  • Show Apple » Recent Items
  • Show the Keyboard Maestro Status Menu
  • Split Array with RegEx
  • Swith Action with Calculation
  • Take NVAlt Note
  • Test { If All Conditions Are Met }
  • Test { Text-Matches }
  • Text Paste Plain Text
  • Toggle ~Library Folder Visibility
  • Toggle Finder Window Open/Closed
  • Toggle Visibility of User Library
  • Toggling between two languages (Swift hack)
  • Tony ; Schools Filter
  • Translate Characters from English to Russian & Change Input Language
  • Typinator Modifier
  • User Input 01
  • User Input 02
  • User Input Creates Collection of Folders
  • Window » Pos, Size Lookup
  • Word & Character Count of Selected-Text { AppleScript }
  • Word & Character Count of Selected-Text { shell wc }
  • Write File with Conditions
5 Likes

Wow. That’s about the sum of it.

Thanks for the share - some serious food for thought here!

Peter I like a majority of these. I assume I could import these to a set so they wouldn’t crowd my other macros?

Chris I could easily use more than half of these. At least to look over and learn from.

Some I am very curious about are:
ACME Telephone Number Look-Up
ACME Telephone Number Look-Up v1.1
Add Prefix to Text on Clipboard
Typinator Modifier - (what does it do?)
User Input Creates Collection Of folders
Finder { Resize Name Column using System Events }
Finder → Rename and Sequentially Number Selected Items
Finder-Selection { Display Paths Briefly }
Finder-Selection { Set Tags of Selected Items to Red }
Folder Watcher
Generate and Paste Email Salutation
Get Most Recent File Added to the Documents Folder
Lookup Email Address
Lookup Email Address v0.02
Meta-Data Report { mdls } - very curious what this does
nvALT { Create New Note } - I LOVE nvALT!!!
Safari Page Text to TextWrangler
Safari Text to TextWrangler
Safari Text to TextWrangler with Processing
Sentence Case
Toggle ~Library Folder Visibility
Take NVAlt Note
Test { If All Conditions Are Met }
Test { Text-Matches }
Text Paste Plain Text

1 Like

Hey John,

I made a mass change in abbreviations a while back, and I used Keyboard Maestro to do the majority of the work by driving the UI and doing find/replace on the clipboard.

It creates a report of the metadata tags Spotlight sees for the selected file in the Finder and opens it in TextEdit.

That batch wouldn't be too hard to clean up, although you'll have to have the Satimage.osax installed for some of them to work.

I'll fool with them over the weekend.

-Chris

The one I posted are all within an Examples Macro Group, so they wont pollute your existing macros, and disabling that macro group will ensure they don’t execute.

Also note a couple things for this sort of question:

  • Importing macros can be undone, so you can import the macros and then undo it.
  • If you quit and relaunch the Keyboard Maestro editor, you can then use the File ➤ Revert Macros menu to revert to the macros as they were when you launched the editor, so you can import macros and then back out by reverting back to “At Editor Launch”.

That said, if you import macros, the macros can run immediately (for example , if triggered by something like Periodic Every Second), so if you are importing a macro from an untrusted source, it can execute something pretty much immediately - this is something to keep in mind if you don’t trust where you are getting the macros from. You can safeguard yourself by holding all the modifiers (Command,Option,Shift,Control) down when importing macros (which will import them disabled), or by relaunching the Keyboard Maestro editor (as above) and then quitting the Keyboard Maestro Engine so no macros are run, and then importing the macros. Then you can look through the macros and verify their behaviour and/or disable them and then relaunch the Keyboard Maestro Engine.

3 Likes

Good to know Peter. Was not aware of the “revert”.

Could I please add my name to this list if you’re willing to share. New to KeyboardMaestro and your list seems too enticing to resist.

Bolli

A post was split to a new topic: Converting Case

@JMichaelTX - I really like this idea, and I did rely heavily on Peter’s example macros to get started with KM and found them very useful. Likewise the email drip campaign after I purchased KM.

I wonder if breaking up this “best of” list into a “Getting started/Intermediate/Expert/Going Completely Nuts” type grouping would be useful. Extend the existing walk through with more examples.

2 Likes

I agree.

Hey John,

Okay. I've finally cleaned these up for public consumption.

Note – Some macros require support files which are iincluded in the zip file.

  • PDF address book file (included).
  • Text address book file (included).
  • AppleScript for resizing the name column in the Finder (included).
  • pdftotext Unix executable (download links included – get the precompiled binaries for the Mac)

Example Macros by ccs.zip (90.0 KB)

-Chris


The following Macros are included


ACME Telephone Number Look-Up v1.0
ACME Telephone Number Look-Up v1.1
Add Prefix to Text on Clipboard
Finder → Rename and Sequentially Number Selected Items
Finder → Resize Name Column using System Events
Finder-Selection → Display Paths in a Window
Finder-Selection → Set Tags of Selected Items to Red
Folder Watcher
Generate and Paste Email Salutation
Get Most Recent File Added to the Documents Folder
Lookup Email Address v0.01
Lookup Email Address v0.02
mdls → Meta-Data Report → Display in TextEdit
nvALT → Create New Note with Tags
Paste as Plain Text
Safari Page Text to TextWrangler
Safari Text to TextWrangler with Processing
Sentence Case
Take NVAlt Note
Test → If All Conditions Are Met
Test → Text-Matches
Title Case → Selected Text
Toggle ~Library Folder Visibility
User Input Creates Collection of Folders


2 Likes

Hi Chris,
Thanks for taking the time. Should I use "Import Macros" or "Import To Macro Libarary"?
I have not run into Xpdf but am intrigued!

Also to install Xpdf I assume I need to: make install?
I see there's an installer for the 64bit version but it's 3.03. Thanks for providing the link as well to the 3.04 download.

-J