In autokey, how can I create a global string variable that can be used by all scripts?
You see, sometimes I need to change this string that I use in many scripts. When I do this, it is a lot of work because I have to modify that string in numerous autokey scripts. If I could create a global variable, I would be able to modify this string in one place, and it would automatically effect all scripts that use it. I need this!
I found this in the documentation:
set_global_value(self, key, value)
source code
Store a global value
Usage: store.set_global_value(key, value)
The value stored with this method will be available to all scripts.
But, where would I put this? Should I simply make a single autokey script that is dedicated to setting globals?
Will those globals survive a reboot, or will I have to run this script after each boot before the other scripts can use the global string I've created?
AutoKey stores global key/value pairs in a dictionary instance of the Store class. When you work with those key/value pairs, you're telling AutoKey to work with that dictionary instance regardless of the script you use to interact with them. Your global key/value pairs are remembered by AutoKey until you either tell AutoKey to change or remove them. Each key/value pair can be accessed from any script. This means that you don't have to go back to the script you used to create a global key/value pair to read it, change it, or remove it.