10-13-2022, 02:28 PM
If want to use script.setup but not in script code, probably the best way is this:
1. Create a class file like this:
2. Add the class file in scripts where you want to use this script.setup, like this:
You can create several such class files, each with different script.setup arguments or completely different code. Then some scripts can use class file 1, some scripts class file 2...
And edit the template in Options. Let it be empty or contain just the /*/ ... /*/.
Note that module initializers run before other code, therefore something may not work. But script.setup should work. Not tested much.
1. Create a class file like this:
// class "script_setup_tray_icon.cs"
class _ModuleInit_ {
[ModuleInitializer]
public static void Function1() {
script.setup(trayIcon: true, sleepExit: true);
}
}
2. Add the class file in scripts where you want to use this script.setup, like this:
// script ""
/*/ c \script_setup_tray_icon.cs; /*/
dialog.showYesNo("Do you see my tray icon?");
You can create several such class files, each with different script.setup arguments or completely different code. Then some scripts can use class file 1, some scripts class file 2...
And edit the template in Options. Let it be empty or contain just the /*/ ... /*/.
Note that module initializers run before other code, therefore something may not work. But script.setup should work. Not tested much.