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.
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
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
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.
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.
@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.
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
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.
Just double-click the Example Macros by ccs.kmmacros file, and it will import into its own group.
There are nine useful tools, but the one I use most often is pdftotext.
It’s a fantastic little tool, and it’s the only such tool I know of that will attempt to preserve the layout of a PDF when it converts it (which makes parsing the resulting text much easier most of the time).
The basic syntax for pdftotext is:
pdftotext -layout <path> -
Replace <path> with the path to your file.
Quote the path with double or single quotes if it has ANY spaces in it.
The trailing dash is required if you want your output to go to the console – otherwise a new file will be written.
No. Read the INSTALL file in your favorite text editor and follow its instructions.
Thanks for the details Chris. I did find the correct directories but what stopped me when I first took a look at this was that I don’t have an /usr/local/man/ directory. I am on 10.11.5 so the MAN path was perplexing and I think I have it figured out. I am posting this so if someone else has problems they will know what to do.
I googled and found I could find out the path to any MAN (manual) document by typing:
MAN COMMAND --path
So for example to find the path to the man page for the MacOS MANual I can type:
man man --path
Which returns:
/usr/share/man/man1/man.1
So I dropped the man files in the /usr/share/man/man1 and /usr/share/man/man5 directories and tested it. Worked!
I was really pleased with how it handles displaying some invoices I fed to it using the ‘layout’ option you suggested.
I took a look at your macros and was delighted to find two for nvALT which is a favorite of mine. I use it for everything. I see you have a tag of scratchx which I am guessing is scratch pad? I am not really using tags too much with nvALT but maybe I will. Thanks for some great stuff. It’s going to take me a little time to get through all these and truly understand how they work but they are great.
I definitely needed “Move Selected Files to Desktop” as an example. I’ve been looking everywhere to find a way to manually move receipts to various quarterly folders and spent considerable time today trying to figure it out. This came in my email today! Thanks so much!