Creating a New Macro


I am trying to make a macro, which can create text-replacement macros. Buidling on Peter N Lewis macro, i am trying to build on it however i need help. The macro takes the clipboard and the user input as arguments and inserts it to an applescript, which builds a macro, that includes:

  1. Set variable to text (the correct output)
  2. Set variable to the trigger
  3. IF statement (is first letter in trigger is capitalised or not)
  4. Filter the correct output, to fit with the trigger
  5. Insert text

However when the applescript is executed the result is not a complete macro. Many of the actions are not included. Any one with script debugger who might be able to help.

I have appended two macros to ilustrate the means and the goal.

A ) Macro that needs help:

Create a spelling replacement.kmmacros (7.0 KB)

B ) Example of output:

artefacts.kmmacros (3.4 KB)

Best Regards

Hey @JensBay,

I tried years ago to give up my text-replacement utilities for Keyboard Maestro.

After creating a few hundred I realized that KM didn't handle that number of replacement macros all that efficiently – so I went back to Typinator.

A purpose-built text-replacement utility simply does the job better than Keyboard Maestro, and it has the added benefit of being able to work in KM dialogs when KM native actions are stalled.

If your replacement needs aren't too huge then KM is fine – but I have nearly 50,000 of them now – and that would be insupportable in KM.

A case for using Typinator.

Good luck with whatever you decide.


Hey @ccstone

Thanks for your reply, it might be the best just to add an app more.

Best Regards

@JensBay, I am not clear on the intent of your post.
Are you asking for help, or just posting a Macro that is complete and ready for others to use?

Please update your Topic Title and post to clarify.
If you need help, please state exactly what you need help with.
If it is for others to use, it should be posted to the Macro Library Category.