Executable Swift Script support

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”.

4 Likes

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.

1 Like

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! :slight_smile:

Thanks,
Denis

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.)

2 Likes

Thanks for the answer and tip Tom!