Steps to reproduce:
Running AppleScript uncompiled
- Create a new action as
Run Apple Script (blocking)and
Source type: Applescript,
for example with this script pasted directly in the BTT script window:
set appName to "Finder" set startIt to false tell application "System Events" if not (exists process appName) then set startIt to true else if frontmost of process appName then set visible of process appName to false else set frontmost of process appName to true end if end tell if startIt then tell application appName to activate end if
Use a timer and benchmark how fast it runs to completion.
Running AppleScript compiled, code-signed and written to disk
Open the same script in Apples
File Format: Script(.scpt) with options:
Code Sign(use your Apple Development profile)
- Save somewhere as your_script.scpt
Reconfigure your trigger to
Run Apple Script (blocking) but with `Source Type: Apple Script From SCPT file"
Benchmark again. No surprise it runs so must faster, but also starts so much faster. No lag.
A: a possibility for BTT to automate this? (compile, code-sign, save, re-import to BTT action)
B: any way for me the end user to automate this somehow?
Keep up the great work!
BTT works great on Catalina now with the recent builds.