What is the best way to keep a repository (personal library) of apple scripts which I use with KBM?

Other than speed, which you initially mentioned when saying "compiled script (.scpt) files is the best and fastest way to use scripts with KM," your other points are pertinent to the user, not as I initially read your comment as "how Keyboard Maestro handles scripts." I was merely asking my question to learn if there was something about KM's execution of scripts besides speed that was better when KM runs a compiled script.

Well, I did day "... to USE scripts with KM". Usually "use" involves the user. :wink:

IAC, in terms of how KM handles scripts, another benefit is that script files are obviously stored outside of KM. That is important because KM stores all Macros in one single file, which gets rewritten every time you make a small change in the KM Editor. A large KM macro file can slow down KM editing and execution.

If you have a lot of scripts, and/or a lot of large scripts, then using script files avoids bloat of the massive KM single macro file.

@JMichaelTX as always, thanks for you sage advice. It turns out that my weird workflow made the SCPT files unreadable to Spotlight. I think I will take your advice and just use the binary files from now on.

1 Like

For production scripts (or anything bigger than ~100 lines and worth it) and scripts for clients I keep things separated:

The source is always stored as plain text (.applescript) and the current version of the script is deployed either as .scpt or .scptd (bundle) depending on the specific context/requirements.

The reason is simple: Plain-text scripts (.applescript for example) can easily be kept under version control. Compiled scripts not so much.

For simple archiving of script files (without version control) it doesn’t matter if plain text or compiled. (Tough plain text is preferable, IMO, because, usually, what I want to preserve is the source, not the representation/implementation.)

Like with any new process you are considering, I think it is best to have a proof-of-concept trial/test with a small sample size before you make a major commitment and conversion effort.

Good luck, and let us know how it goes.