No, there is no “Paste Replacing Selection” option for actions. Maybe there should be, but its kind of an odd usage case. That said, it would make “Engroup” a lot easier.
What you could do would be something like:
Cut
Modify the clipboard
If the Copy menu item is enabled
Command-Option-V (Paste Above)
Else
Paste
After cutting an item, the following action, if any, will be selected. So if the Copy menu is enabled, paste above works, and otherwise, paste will append to the end which is what you want if you cut the last item.
Thanks. I could swear there are instances where this doesn’t work correctly (the pasted action went in the wrong place), but I can’t currently verify it. The instances had to do with whether the selected action was at the bottom a group or an IF statement.
But since I can’t duplicate it right now, I can’t be sure. I may try and experiment tomorrow.
And no, I wasn’t expecting you to change anything to make this easier, although you make a good point about “engroup” (great term).
I sometimes wish each action had its own UUID, and that there was a scriptable way to select/move to an action by its UUID (perhaps edit the macro first, then select the action by UUID). For instance, if I wrote a custom search, I could pinpoint the exact action that the search found. Also, it would make it trivial (sort-of) to modify the selected action, engroup it, etc.
But honestly, it’s not important enough to to make this a priority. I could give you a handful of things I’d rather have before this, so I’m really just thinking out loud.
I’ve considered adding a UUID for each action, but it would add a lot of storage space in the macro file which is not ideal, and then there are ever more places where I have to figure out if the UUID needs to be refreshed (option-draging, copy & paste, import, etc).
@DanThomas, @peternlewis Perhaps a not too bad compromise can be a kind of Action of Interest bookmark: in the mid time we can survive using a dedicated comment labelled by a UUID as a simulated such bookmark…