Search code examples
codesys

Codesys ScriptEngine tool/key binding


I have created some scripts in (Iron)Python that help me with the generation of a lot of the boilercode in my project. However, every thime I change something in some part of my project, I have to rerun those scripts. Right now, every thime I have to go to the menu -> Tools -> Scripting -> Execute script File... and navigate to the script in the File Explorer.

However, I go into Tools -> Customize... I can see that there are listings for Script0, Script1 and etc. They are also available in the keyboard shorcut bindings. This suggests to me that there must be a way toadd ToolMenu entries and key shortcuts to run predefined scripts, however all of them have "(unavailable)" written next to them, and I can't figure any way to configure them and make them do something.

Tools customization window

Does anybody know how to make use of them?


Solution

  • Follow this instruction: https://content.helpme-codesys.com/en/CODESYS%20Development%20System/_cds_executing_scripts_toolbar.html

    Note: What you see in "Add commands" under "Scripting Commands" is a alphabetic index list of your script file names. That means if no scripts are active linked in config.json then the count of maximal possible 32 scripts are listed under alphabetic index "S" as "Script0(unavailable)" to "Script31(unavailable)". If linked one script in config.json then is listed under alphabetic index and "Script0(unavailable)" is hidden.