After switching away from my app, I have to switch to KBM first

I know that Java apps like my CafeTran behave differently on El Capitan. Nevertheless, I don't have any native alternative for this app.

The problem that I'm facing is: When I switch from CafeTran to Safari, Mail etc., I cannot trigger macros like the attached one. Instead, I have to click on Keyboard Maestro first and then on CafeTran.

Can this be fixed?

Hans
Make initial uppercase after tag.kmmacros (17.6 KB)

I’d really appreciate some help here, even when it’s a Java program that causes the irregular behaviour.

Thanks!

Hans

Hey Hans,

This seems to activate CafeTran reliably.

tell application id "com.cafetran.CafeTran"
  if not running then run
  activate
end tell
tell application "System Events"
  set frontmost of processes whose bundle identifier is "com.cafetran.CafeTran" to true
end tell

Do all of CafeTran’s windows that you work in have ‘CafeTran’ somewhere in the title?

If so you could use a window-name-based activator for the CafeTran group instead of just excluding applications.

CafeTran’s developer has named the internal executable ‘JavaAppLauncher’ for some reason.

I feel like he’s done something wrong somewhere, and that plus Apple’s changes to Java-based-apps in El Capitan are at the root of the problem.

When this AppleScript is compiled:

tell application "CafeTran"
  # Stub
end tell

It transforms into this in Script Debugger:

tell application "Script Debugger"
  # Stub
end tell

It takes on the name of the Script Editor it is compiled in (Script Debugger, Script Editor, or Smile), and that indicates something is quite wrong in Denmark…

-Chris

Hello Christopher,

Thank you for looking into this!

When I execute your first script while CafeTran isn't running, it is started. However, when CafeTran is already running and I'm in Mail or Safari, the script doesn't activate (pop up) CafeTran.

The string 'CafeTran' is in the main app, not in dialogue boxes like Find and Replace or New Term. But it would already be a great help if I could reliably activate the main app. So, when you write:

If so you could use a window-name-based activator for the CafeTran group instead of just excluding applications.

Is this a command that I'll find in Keyboard Maestro's pick list right away?

I'll point CafeTran's developer to your posting and hope that he'll look into this/make the necessary modifications to the app.

Thank you once more!

Hans

It looks like these commands reliably activate CafeTran:

I'll try to incorporate this sequence into my macros tomorrow.

Related to this: In CafeTran I can open a pane that shows the statistics of my translation project. I could position this pane on my second screen with:

Now this macro stopped working for this specific windows. How could I get it to work again?

CafeTran’s developer has named the internal executable ‘JavaAppLauncher’ for some reason.

On my MacBook Pro I’m running El Capitan. There I could address JavaAppLauncher. On my iMac I’m still using Yosemite, there I cannot find JavaAppLauncher in the list of recent apps nor in More…

So there’s no one solution that fits all, is there?

Perhaps this window title approach?

I’m happy to report that I’m up and running again. With the great help of Christopher, I was able to port my macros to El Capitan.

Great weekend,

Hans

Hey Hans,

This macro is completely reliable on my 10.11.1 system with CafeTran 4.0.1.

-Chris


Open or Switch to CafeTran.kmmacros (1.8 KB)