KBM Stops After Activating Application


Hi Everyone,

I have a macro I've set up to get information from one screen (we'll call it App 01) and then activate a specific application (App 02) and paste this info into App 02's screen.

It all works perfectly except for the paste function at the end. It's as if KBM is unable to carry out the paste function once App 02 has been activated.

App 02 is a Java-based tool and I'm just wondering whether this is the problem in some way. I've modified my macro to copy the data from App 01 and paste the results to TextEdit and it works a treat every time. If I change this back to pasting the data to App 02, it just activates App 02, but doesn't paste the data. I have to do this manually.

Any ideas?



What's this second app you're trying to paste to, and how exactly are you trying to paste it in the macro? It would also help us a lot if you could post your macro itself. If you're not sure how to do that, you can find instructions here: https://wiki.keyboardmaestro.com/Forum#How_to_PostUpload_Your_Macro_to_the_Forum


App 02 is a Java-based translation management tool called CafeTran.

Pasting is being done via the standard KBM paste function (please see attached screenshot).



The most common reasons this macro would stall on paste are:

1.) 1 second may not be enough.

2.) Upon activation of CafeTran, there is no focused object to accept the pasted data.


Extending the pause hasn't corrected the issue and once focus is placed on CafeTran I just press Ctrl+V manually and it pastes the data, so I'm not sure how to modify the focus in the macro so that it just completes the function "press Ctrl+V".

As above, if I select TextEdit as the tool to receive the pasted data rather than CafeTran, this works "out of the box" so to speak. Switching this back to CafeTran (and making no other changes to the macro) results in it not completing the paste function.

It's like it just fails to run "press Ctrl+V".



A similar test macros worked fine with CafeTran for me even without a pause, so I'm afraid I'm not sure what could be wrong. Just out of curiosity, does it still fail to work as expected if you type some text into CT manually, switch to another app, and then run the macro?

Either way, it can't hurt to try KM's Assistance feature from the Help menu.


Thanks for your reply.

Typing text in manually and then running the macro doesn't seem to change things. It still fails to complete the "Cmd+V" paste function.

I've been typing Ctrl+V in my examples above, but I had my Windows hat on at the time. I'm actually using a MacBook Pro and so the paste function would be Cmd+V, not Ctrl+V.

What app are you moving from to return to CafeTran and how have you set up that part of your macro? Can you share a screenshot?

I don't have an Assistance feature in my Help menu for KBM. I'm running version 6.4.8, so perhaps that's the reason.

For what it's worth, here is my full macro. It uses the Epic browser to access a customer's in house tools for a project I'm working on for them. I can't say more than that due to an NDA I have with them.

KBM Forum Example.kmmacros (8.7 KB)



The Assistance feature was added in KM 8, so no, it wouldn't be available in 6.4.8, I'm afraid.

My test macro is very simple. I tried running it from within a few different apps, and it acted as expected each time:


I took a look at your macro, and didn't see anything that would explain why the last step fails in CafeTran. It's also very strange that it fails even after you've made sure it accepts text input. As a last-ditch idea, is your version of CafeTran up to date? I just downloaded the latest version today, which appears to be "CafeTran Espresso 10.5 Croissant."


Thanks for that.

No, mine isn't the latest CT. I heavily use KBM with this app and have found on past occasions that when I upgrade, it wrecks most of my macros, so I have to spend a few hours sorting them out again. It's just not worth the overhead in time to me.

I'll just keep manually pasting. It's the easiest way to deal with the problem and I'll have another look when I eventually upgrade CT.

Thanks again for your help.



Java apps are less and less supported by Apple.

The simulated keystrokes use a different (newer) API in version 8 from the ones used in version 6 (I believe), so that is probably what the difference is (that or OS X version differences).

Unfortunately, it seems that the simulated keystrokes simply is not working for you in CT, I'm not sure there is anything that can be done without upgrading (which may or may not resolve the issue).


Actually, another possibility is that the Activate Application is never finishing, because the application never appears to come to the front because Java applications are no longer well supported.

Set the timeout on the Activate Application to show, and disable abort on timeout, and see if that helps.


Thanks, Peter.

I don't see an option for showing a timeout value for Activate Application. Can you tell where I can find that?



In the gear menu in the action, you can set the timeout and other options.


As they say, a screenshot is worth a thousand words:


Unfortunately, my version of KBM doesn't include this option:


Ah right, you're on an older version of KM. In that case, check the View menu:




By taking the tick out of the "abort macro after timeout" option and setting the timeout value to "1", this now works. :smiley:

Outstanding. I really appreciate everyone's help with this.