Change Macro Name

Hi, i'm new here.
First of all, thanks for this nice software, coming from ControllerMate and Lemur, this helps me to programs Midi Controller to drives softwares.
so, I checked the topics and it seems that there is no way to change Macro name by variable or so.
Maybe it exists another way to do that, like applescripts ?
My problem is that i use a palette who presents a list of macros, and obviously when u click on one it fires it, but each macro calls an apple script that apply a style based on a text name. This text name can be changed in a preference menu but then the macro doesn't have the good reference name anymore.
Hope it is clear enough,
thanks for your help
Regards and sorry for my "french based" english !
efra

Hey @efra,

Welcome to the forum!  :smile:

If you haven't read this it's worth a couple of minutes of your time.

Tip: How Do I Get The Best Answer in the Shortest Time?

It would help to know the name of the application in question and have an image or two of the issue at hand.

-Chris

Thanks for the quick answer, yes i've readen it and maybe my question was confused
So i will sum up because i think it's only relative to KM :
From what i read on the forum, you cannot insert variables in a Macro name
So, is it possible to change the name of a macro with an applescript ( and if possible without KM opened - only KMengine ) ?
Hope it's clearer like that
thanks
efra

Hey @efra,

No, your question is not clear at all. (At least to me.)

Why does the macro name need to be changed?

You're applying a style, but you don't say in what application.

You don't provide any illuminating images.

You're not providing a very clear picture of the process your task needs to accomplish.

To get good answers on the forum you need to provide all the information some one else (who isn't at all familiar with your task) needs to understand it.

This is generally better than asking questions piecemeal, because knowing the the capabilities of Keyboard Maestro well we can often see solutions you haven't thought of.

A bunch of simplistic back and forth questions and answers and then related questions and answers becomes frustrating for both sides and is not very conducive to solutions.

If you want people to help you then you need to capture their interest and give them the necessary tools to work the problem without having to jump through too many hoops.

-Chris

2 Likes

What don't you start with what is the objective or purpose of your Macro?
If you need to call a different sub-macro (Execute a Macro action ) under some conditions, then you can easily use a If Then Else action.

Ok ok sorry, it's clear that I wasn't clear.  :wink:

So, I use KM to send macros to CaptureOne which is a photo editor.

I display a palette with a list of macros.

palette

When you click on one, it triggers an AppleScript :


script1

The script goes find what is the Variable "StyleX" (X from 1 to 10 depending on which macro you clicked on) and then apply a Filter in CaptureOne with that precise name.

So I made a prompt list in KM so u can change the name of the style u want the script to refer to, depending on your own styles:

pref

So it works fine but when u change this styles in the prompt list, I'd like also that KM changes the name of the macro in conjonction so for example, if in my prompt list of styles I choose:

Style1=AAA
Style 2 = BBB

...

Then in the palette I would have the list :

AAA
BBB

...

Hope this is clear enough.
Thanks in advance.

efra

Hey @efra,

Okay, that's a much better description.

Here's how to get the UUID of a selected macro for use elsewhere (see the next script).

--------------------------------------------------------
# Auth: Christopher Stone
# dCre: 2020/11/17 18:38
# dMod: 2020/11/17 18:38 
# Appl: Keyboard Maestro
# Task: Get the UUID of the Selected Macro.
# Libs: None
# Osax: None
# Tags: @Applescript, @Script, @Keyboard_Maestro, @Get, @Macro, @UUID
--------------------------------------------------------

tell application "Keyboard Maestro"
   set {selectedMacroUUID} to selectedMacros
   set the clipboard to "\"" & selectedMacroUUID & "\""
end tell

--------------------------------------------------------

Here's how to rename a macro with a given UUID:

--------------------------------------------------------
# Auth: Christopher Stone
# dCre: 2020/11/17 18:50
# dMod: 2020/11/17 18:50 
# Appl: Keyboard Maestro
# Task: Rename a Macro Using its Permanent UUID.
# Libs: None
# Osax: None
# Tags: @Applescript, @Script, @Keyboard_Maestro, @Rename, @Macro, @UUID
--------------------------------------------------------

tell application "Keyboard Maestro"
   tell macro id "B02C5FA8-8BB9-4E6F-90DC-CC6431149A85"
      set its name to "By Your Command..."
   end tell
end tell

--------------------------------------------------------

Given these two puzzle pieces you should be able to figure out how to complete your objective.

Holler if you get stuck.

-Chris

1 Like

Hi Chris,
and thank you for your help
i'm not very familiar with scripts or programming, but i'm going down in this tunnel, with your maps and hope to find my way out
regards
efra

1 Like

Thanks again Chris, it works nicely !
Not familiar with forums, do i have to close the topic or something?

1 Like

Nyet.

The thread is left for posterity.  :wink:

-Chris

:ok_hand: thanks again

1 Like