0agent 1.0.71 → 1.0.72
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/daemon.mjs +3 -4
- package/package.json +1 -1
package/dist/daemon.mjs
CHANGED
|
@@ -3348,12 +3348,11 @@ print("Typed successfully")
|
|
|
3348
3348
|
const keyStatement = keyCode !== void 0 ? `key code ${keyCode}${usingClause}` : `keystroke "${mainKey}"${usingClause}`;
|
|
3349
3349
|
return header + `
|
|
3350
3350
|
import subprocess, time
|
|
3351
|
+
# Activate app to give it OS focus, then send key to frontmost (whatever has focus)
|
|
3351
3352
|
subprocess.run(['osascript', '-e', 'tell application "${safeApp}" to activate'], capture_output=True)
|
|
3352
|
-
time.sleep(0.
|
|
3353
|
+
time.sleep(0.5)
|
|
3353
3354
|
as_script = """tell application "System Events"
|
|
3354
|
-
|
|
3355
|
-
${keyStatement}
|
|
3356
|
-
end tell
|
|
3355
|
+
${keyStatement}
|
|
3357
3356
|
end tell"""
|
|
3358
3357
|
r = subprocess.run(['osascript', '-e', as_script], capture_output=True, text=True)
|
|
3359
3358
|
if r.returncode == 0:
|