Timeout with InputSwitcher #22
Unanswered
guenthermahr
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
thank you for your code, which I thought would help me a lot! When I tried it out on Mac 12.6. it first worked perfectly, but after a while it stopped working for unknown reasons. I actually execute it from an app as an osascript command in Java like this:
private String script = """
ignoring application responses
tell application "System Events"
click menu bar item 1 of menu bar 2 of application process "TextInputMenuAgent" of application "System Events"
end tell
end ignoring
Then I replace "tastatur" in the script with the keyboard name and process it:
String scriptWithRightKeyboard = script.replace("tastatur", """ + keyboardName + """);
Runtime runtime = Runtime.getRuntime();
String[] arg = { "osascript", "-e", scriptWithRightKeyboard };
Process process = runtime.exec(arg);
As I said, it worked, and the very strange thing is that it still sometimes works (very seldomly), but most of the time I run into a
1712 timed out error after 2 Minutes.
Any idea would be very helpful. Thank you!
Günther Mahr ([email protected])
Beta Was this translation helpful? Give feedback.
All reactions