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