[Za...] Posted September 8, 2022 Share Posted September 8, 2022 Hi, How do I create a user-defined script which can accept arguments? For example, I would like to call scriptA in scriptB. And scriptA basically just printout a simple message which I pass to it. Example in scriptB: gom.script.userscript.scriptA('Hello World!') Thank you mau Link to comment https://qualityforum.zeiss.com/topic/1357-how-to-create-a-user-defined-script-that-accepts-arguments/ Share on other sites More sharing options...
[Th...] Posted September 12, 2022 Share Posted September 12, 2022 I guess it will not work by the gom.script.userscript-mechanism, which only can run a script. But it should work by the import-mechanism of python itself. Put everything you need in a function with parameters and call this function from another script after you imported the script. Example for scriptA: def showMessage (message): print (message) Example for scriptB: import scriptA scriptA.showMessage ("Hello World!") This also works inside the folder structure inside the GOM Software in the script editor. Link to comment https://qualityforum.zeiss.com/topic/1357-how-to-create-a-user-defined-script-that-accepts-arguments/#findComment-4513 Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in