Do we know how large a string a KMVAR can hold ?
Is the constraint something like (in Bash):
~ $ getconf ARG_MAX
or possibly less ?
( I’m thinking of using KM in my work as a construction kit for file conversions to and from various formats (through a JSON intermediate form) and I’m wondering whether it might not be prudent to build in some size checks and warnings in case of larger files )
Keyboard Maestro variables have no limits on their size.
But, and this is a very big BUT currently, if the total size of your Keyboard Maestro variables exceeds the system’s limit of environment variables, then no scripts in Keyboard Maestro will work because Keyboard Maestro puts them all in the environment variables and then tries to launch the script and the system rejects it. This means all scripts fail, including things like AppleScripts.
Keyboard Maestro 7 will limit the size of the environment by excluding the largest variables. After that, you can still have any size in a variable, but it will not be accessible via the environment variables - but you can still access them via AppleScript. However from a shell script, you may run in to limits on their variables if you want to store the whole lot in a variable (as far as I am aware, perl has no limits on its variable sizes for example).
But all that said, you may be better off storing very large chunks of data in a file instead of a variable.
you may be better off storing very large chunks of data in a file instead of a variable.
Thanks ! Very helpful to have a clearer picture, and that seems a good approach.