After Macro Executes, Keyboard Locks Up

Hi,

I have a complex text transformation macro which starts with selected text.
After a particular sub-macro (here) executes, even though the text editing app is apparently active and even when I specifically include an action to activate the app, my keyboard is locked. Which means I can’t hit an arrow key to deselect the text.

None of the keys in isolation seems to work. Nor does a subsequent “copy” action or keystroke action work. All elicit the “boomp” sound. (Notably, hotkey combinations for KM do seem to work.). Only by clicking in the text edit window can I restore keyboard functionality. Ideally, I’d like to automatically trigger a subsequent macro which copies the selected text. But this always fails. I have to click in the app window to get back to functionality.

If anyone has any ideas, I’d be appreciative.

It sounds like the macro is causing the foreground app to lose focus, essentially putting it in the background even though it looks like it's still the frontmost app. Adding an "Activate a Specific Application" or "Bring Window to Front" action, perhaps followed by a "Pause Until [MENU ITEM IN TEXT EDITOR] is Enabled", right before running the macro that's supposed to copy the selected text seems like it should fix the problem. If it doesn't though, it would help if, in your follow-up post, you uploaded and included screenshots of all the macros involved in your desired process (preferably all uploaded locally to this forum, rather than to Dropbox or Droplr) along with telling us exactly what text editor you're using.

A few other miscellaneous comments on this sub-macro:

• If you're using KM8, you no longer need to set variables to %Delete% to hide them. You can just prefix them with "Local" or "Instance" (depending on whether and how they're meant to be used as sub-macros) and they will be restricted to just that macro or that macro execution instance, thus achieving the same effect as setting them to %Delete%.

• Whether you set variables to %Delete% or prefix them with "Local" or "Instance," if you're going to do that, there isn't any benefit to using them as placeholders in actions like this:

since they'll always be empty when the macro is run. If you want to use variables as placeholder values like this, you need to neither delete them nor prefix them with "Local" or "Instance" (in your current macro, just deleting or disabling the relevant "Set Variable to %Delete%" actions would be the easiest way to do this and preserve the variables' values across macro executions). If you're setting these macro values in a different macro before this one is run, so that they will have placeholder values once the sequence reaches this point, then of course they'll serve their intended benefit, but in that case, you may want to consider setting and deleting these variables in the same macro, rather than setting them in one and deleting them in another (for future organizational ease-of-use if nothing else).

• If you're generating a new file every time the macro is run with this action:

Then you probably want to make this "Write Text" instead of "Append Text." If you do mean to append text to an existing file, then you probably don't want to use a variable for the file name, since that leaves room for consistency errors.

• This may have been intentional since the macro currently isn't working as you expect, but in the version you posted, the final "Execute a Macro" option is set to execute no macro. Perhaps that's also contributing to the unexpected behavior you're seeing?

Good luck with resolving this issue! As always, feel free to post again if you have further questions, and let us know how it goes!

If the suggestions by @gglick don't fix your issue, you might try using the intelligent KM wizard known as "Assistance".

Follow this process:

  1. Open the KM Editor app, and goto menu Help > Assistance
  2. Choose the "Something unexpected is happening"
  1. Leave that open, and now switch to the app where you are having the issue.
  2. In that app, trigger the macro that causes the issue.
  3. When the unexpected happens, switch back to the KM Editor, and follow the Assistance suggestions.

If your issue remains, post back here with more details and questions.

1 Like

Thanks for your input. I’ll work with these suggestions and report back.

-B