04-10-2015 06:20 AM
Hello,
I want like to start a DIAdem-VBS-Script automatically by opening that script with DIAdem. I have tried it with the commands: AutoStart(), ScriptStart() and Script Include(). Any of that commands does not work.
Is it possible to give me some examples of that commands or the solution with a similar command?
Thank you in advance,
Thomas
04-10-2015 12:25 PM
Hello Thomas,
There are several ways to start a Script when you start DIAdem. This on is the easiest:
In DIAdem, go to the "Settings" menu - then pick "DIAdem settings" from the drop-down menu. In the "General" section of the settings dialog, pick the "Start Script" section highlighted below.
Pick your Script here and then save the configuration file by returning to the "Settings" menu and selecting the "Save As ..." function - you can overwrite the default "desktop.ddd" file. The next time DIAdem starts it will execute the Script you have selected right after start up ...
You can also start DIAdem with a parameter in the command line:
Launching DIAdem with Start Parameters
Use the following parameters to modify how DIAdem behaves after the program launches:
/CCommand Specifies a command that DIAdem executes directly after the program launches. For example, this parameter can start a script. DIAdem.exe /CScriptStart('MyScript.vbs')
/DFile Specifies a desktop file. DIAdem.exe /DMyDesk
/SFolder Specifies a System folder. DIAdem.exe /Sc:\user\mysystem
/TDMOnly Starts DIAdem without DIAdem DAC and DIAdem VISUAL. DIAdem.exe /TDMOnly
Note If you use paths that contain the space character, you must enclose the paths in quotation marks, for example:
"C:\Program Files\National Instruments\DIAdem\DIAdem.exe" /CScriptStart('"C:\MyProject 1\MyScript.vbs"')
Note Instead of starting the program with parameters, you also can specify a start script in the General Settings dialog box. When DIAdem launches, the program registers this script and executes all the commands from the main section of the script.
A third alternative is User Commands, which is the most complex way to start a Script when DIAdem starts ...:
You can select "Settings»Extensions»User Commands" and define User commands, to add your own commands to DIAdem or to redefine existing commands. DIAdem automatically executes the script that contains these user commands, when the program launches.
My recommendation would be to edit the Settings dialog, let me know if that worked out for you!
Otmar
04-13-2015 02:00 AM
Hello Otmar,
thank you very much! I am already using these features in respect to other tasks.
But I do not want to start the script automatically by starting DIAdem.
I am searching for a option to start the script by opening the script with DIAdem in the windows folder. Thereby the Script opens in DIAdem and starts automatically.
Thank you again,
Thomas
04-13-2015 05:29 AM
Hi Thomas,
I hope the request is understood 🙂
You do not want to auto start a script from DIAdem configuration, or from command line. But yet want to autostart a script.
I have done something where scripts were in a specific directory, it would automatically read all the scripts and execute the desired one. (this scripts to change over time, and the report application will auto update)
Is this closer to what your use case is?
The commands to do this are either one of the two below.
ScriptStart | ScriptInclude |
I prefer the scriptinclude command if possible. I would add to it a global (C++ like guard so that the script will only be executed once, this is done with a global) Without this guard the scriptstart command would be used if this script could be called more than once.
Paul
ps. I can send more details, but lets get the need identified first.