Naming Convention for Macro & Macro Group [Tips]


Currently there is no standard way to name macros and macro groups. Everyone name them differently according to their needs. Some may not know how to name them effectively to leverage on KM Editor Search capability to find them. Over time, when macro collection grow large, they find it hard to reuse the macro and to identify the macro use in some actions (eg Execute macro) without extra effort. So this article is based on my own ways to help effectively use KM Editor to make for pleasant macro development.

Development is hard enough but not having a good naming convention just make it harder. This is more so when macro become more sophisticated with more actions that call other macros.


The following are suggestions that work for me, and it might just work for others.

My thought process

When first started, I too try to figure what is the best way to organize and to name macros and their groups. I notice that 70% of macro groups are just specific to single application, hence it make sense for me to have a naming convention primarily based on application ( majority win, right ?) . From software development point of view, software projects have unique project id or short code (eg MS ) and the issues related to the project is prefixed with project-id (eg MS-14 ) so to help quickly identify the project it belongs to. KM users could adopt similar meaningful way.


The Naming System consists of two parts: Primary Naming and Secondary Naming

Primary Naming: Uniquely identify macro groups and macros (This is compulsory except for Smart Folder)

  • Macro Group has a Macro Group Code (MGC: short characters that uniquely identify the macro group, preferably 3 characters average )
  • Macro has a Macro Group Code (MGC) Prefix

Secondary Naming: Identify the type of macro (This is optional)
Macro Naming: For example

  • All functions and subroutine ( Execute type of Action)
    • after group code, identify function by keyword: <Func:> / <Func*>
  • By other means
    • <Cron>, <Periodic>, <Menu Item> etc

A macro name having

  • "Func" keyword means this function is call by other macro to perform one specific function.
  • "Func*" keyword means this function has several functions callable by switch-case Action

For example [A specific application]
Given that Firefox browser has several macros that only work with it. The following Naming convention can be used.

Macro Group Name: a_Firefox = FFX
Macro Name = [FFX] Web Scrape
Macro Function Name= [FFX] <Func*> Web Scrape

Another Example [A KM's Menu KMApp]
In this case, I using KM's Menu for KMApp Time Tracker

Macro Group Name: m_Time Tracker = _TTR
Macro Name = [_TTR] Display Current Usage
Macro Function Name= [_TTR] <Func*> Time Tracker

I use _ as prefix in group code to show it as Menulet KMApp

What are the benefits of Macro Group Code (MGC) ?

  • It avoids repetition and erroneous identification. Macro is generally bound to certain application and identification, and user is wise to name them with correspondent entity. Without MGC, the macro name may contain having mistyped name and casing (less character is less mistake)

Without MGC:
Macro1: Firefox: Move to Next Tab
Macro2: fireFex: Move to Previous Tab

With MGC:
Macro1: [FFX] Move to Next Tab
Macro2: [FFX] Move to Previous Tab

As illustrated, MGC is self-explanatory, and there less room for error as it has fewer characters (normally 3 characters) and using all uppercase [no more figuring about character casing].

  • Macro Group Code can easily be identified by Group Column in KM Editor.

  • One less token to Log. Since the MGC is embedded in macro name, it does not require macro group token.

  • Filtering and Sorting by Search eg [KAP] , the search list will show all item belong to that macro group code.

  • Easy identification . The macro in "Execute Macro Action" can easily be identified by what macro group it belongs to.