Init Scripts
Requires Kojo Version: Beta-050611-1 or later
You can run any Kojo code that you want (to, for example, define your own commands/functions/classes) - when Kojo starts up. To do this, you need to do one of the following:
- Determine your Kojo install dir (this is the location where you installed Kojo).
- Locate a directory called kojo under the install dir.
- Create a dir called initk under the kojo dir (if it does not already exist).
- Put the code that you want to run at startup into a file (the file extension should be kojo), and copy the file into the initk directory
- Start Kojo. Kojo will run your startup code, making any commands/functions that you define within your code available to you within the script editor. As it starts up, Kojo will also print a message in the Output window telling you that your script has been loaded.
OR
- Determine your Userdir. If you run Kojo and click on the Help -> About menuitem, you will see your Userdir right at the bottom of the About dialog.
- Create a dir called initk under your Userdir (if it does not already exist).
- Put the code that you want to run at startup into a file (the file extension should be kojo), and copy the file into the initk directory
- Restart Kojo. Kojo will run your startup code, making any commands/functions that you define within your code available to you within the script editor. As it starts up, Kojo will also print a message in the Output window telling you that your script has been loaded.