I have a couple of items that are somewhat related to each other.
1. #scriptScript bug?
I've noticed what I perceive to be some issues with hidden scripts (that should use the #scriptScript tag).
Scripts can not be created in a text editor and saved in the appropriate directory so that Test Controller recognises them - they can only be saved via the UI in Test Controller.
Any modification to a script in a text editor results in Test Controller being unable to execute the script.
Script can easily be edited and save with any plain ascii text editor, but you have to use the correct name and file location
Anything in ...\Documents\TestController\ScriptLibrary must end in ...Script.txt
And again: Use a plain ascii text editor, no extra control characters is allowed.
Saving a hidden script via the UI does not add the #scriptScript tag to the start of the script.
Hidden scripts by design can not be accessed by the menu for execution, which makes sense. However if Test Controller will not accept hidden scripts created or modified by a text editor, then they need to be listed under "Generate Scripts > List and manage scripts".
The UI do not by itself support hidden scripts, it is something you have to do.
I sort of agree with you about the management.
2. File dialogue convenience
It seems all file browse dialogues (on Windows) open to the last accessed directory. This makes sense for most programs, however I think it needs to be more granular:
For example, if from the Commands window I select "Save > Save as log", then it should default to the data directory (either the custom directory passed as an argument when starting, or the default directory if this is not present).
However, if I select any of the other options that are related to scripts, it should default to the script directory.
In the grand scheme of things these are minor gripes, but they make life a lot easier when you have vast directory structures to navigate to find your way back to the correct location - especially given that the file browse dialogue in java is fairly primitive.
The script directory is for menu scripts, not for any random script you make.
Most save dialogs remember the last save location, until you restart TC.
3. Return variables from a script
I'm struggling to determine the syntax for returning a variable from a script that has been called.
I know in C it would be return <var_name>, and the function would be called with an assignment:
uint8_t new_variable = FunctionWithReturn();
But I can't work out how to do this with the Test Controller syntax. The only method I have found so far is to create a global variable in the parent script, then assign to that variable within the child script, but that is not good practise for flexible code.
There are two ways to return values:
1) Last line of you script generate a value: It can be a function with a return value or a expression. Any datatype can be return this way.
2) You use the print() statement, it can be used multiple times in a function, the return value will always be string.