It would be great if we could point the “Execute script file” to a compiled swift script. It would greatly improve execution speed. Any chance this could be supported in the future?
You can execute compiled Swift scripts with the Execute Shell Script action. Set it to “Execute script file”.
I tried with a compiled script file and it didn’t work. It seems to work only with script.swift files. And yes my compiled script file was set to executable.
Oh wait I see my mistake, you’re using an “execute shell script” instead of “execute swift script.” That didn’t occur to me that I could run a (compiled) swift script using the shell script command. Seems to work!
You can also simply drag your compiled Swift file into a macro, and KM will auto-insert the correct action, populated with the path. At least with KM8.
More precisely: If the macro is empty drag it onto the “No Action” field, if there are already actions then drag it below or above the action where you want to place it.
(This works also with uncompiled script files and with other file types.)
Thanks for the answer and tip Tom!