Have some macros that have a lot of duplicated actions in them, ie, Macro A has 5 actions, and Macro B also has 5 actions, and both share 4 out of those 5 actions.
So, would like to simplify those KM macros that share a lot of the same actions by:
Merging them as possible
Use TriggerValues to use actions depending on passed value(s).
But would like to know: Is there any advantage of having them as separate macros (as they currently are), versus
is there any advantage of having them as part of the same macro.
In my case, as an example, I have a macro that scrolls the view of the image I am currently editing in Adobe Lightroom. I could have had 4 macros (one each for scrolling up, down, left and right) each consisting of 15 actions. In each of those macros only 1 action is unique to that macro. So that's 60 actions spread over 4 macros with 56 actions the same and 4 different.
Instead, I chose to implement it as a single macro consisting of 30 actions the "main" one being a Switch action that branches depending on the %TriggerValue% that's passed to the macro in the first place.
Why did I chose one over the other? The answer is clarity and ease of maintenance. For example - the %TriggerValue% is generated by a press of a button on my Stream Deck. If I wanted to change the triggers from say "Up" to "u", "Down" to "d" and so on, I know exactly where In KM I need to go to support those changes - it's a single macro and not 4 different ones.
I can imagine times when you might have a macro that, when it's triggered, will then go on to execute one of a number of possible sub macros depending on the %TriggerValue%. I have a couple like that - the "worst" one being a single macro that potentially executes one of 25 different sub macros depending on which web page is currently showing in my browser. This implementation makes it easy to add the triggering of extra sub macros as and when I need to add the processing of additional web pages. By the way those 25 sub macros have little in common even though they all do something similar (update clients' websites via admin functions). Why did I choose to do it that way? In actual fact I just wanted to be able to hit the same hot key on whichever web page I'm on without having then to see a conflict palette; in effect, the single macro that the hot key triggers looks at what web page I'm on (via the %TriggerValue%) and then uses a dictionary look-up to decide which sub macro to run.
So I can see great benefits to doing things this way.
As for your case: if there is the possibility of adding more macros into the mix in the future, I would probably consider merging them somehow. But - if you're only ever going to have those 2 macros and you're happy having separate hot key triggers or a conflict palette to run them then leave them as they are.
Yes, maintenance is also one of the main benefits I'd see if I merge macros, I guess it'd also make it easier to debug.
The only part that makes me doubt is that a merged macro will be larger, will have more actions and switches and whatnot (which seems to be the only con), at the expense of a leaner KM with fewer macros.
Merged four macros into one, working great
Have other two macros that called two of those previous macros (using an Execute Macro), still not sure how to proceed. Edit:
Will try merging those two as well and use TriggerValue for these as well.
If I enter the up arrow symbol ↑ in the "With Parameter" input field,
this is what will get transferred to the TriggerValue?
Used in a Macro that triggers using keyboard arrows, and want to pass the Up Arrow key as the parameter
All of the positive points mentioned here are well taken on the use of multiple hot-key triggers for a single macro, but may I add a slight caveat? I often find myself wondering if I've already assigned a particular hot-key trigger to some macro because I'm thinking of using that trigger for a new macro, and so I select All Macros, sort by trigger, and see if it's in the list. But if a macro has multiple hot-key triggers, only the first appears. Just something to keep in mind (and if there's another way to determine if a hot-key trigger is already in use – apart from trying it and watching for the conflict palette – I'm sure someone will clue me in! )