DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Programatically adding a 'user command'

Hi,
 
I have a VBS script that I would like all of my users to have included as a 'user command'.  I can usually set this up when I am installing DIAdem, but sometimes either that doesn't happen or it gets lost, etc.  Therefore, I would like to add a user command programatically.  I can add the user command script with Call ScriptCmdAdd(FilePathAndName.VBS), and this works as long as DIAdem is open.  But it gets lost when DIAdem closes & restarts.  Therefore, I have tried to save the desktop settings through a Call DeskSave("Desktop") or Call DeskSave(ProgramDrv & "DeskTop") but this doesn't seem to work, and I get the same behavior as if I didn't save the desktop.  Also, if I add the user command script programatically and manually save the desktop, it also doesn't work 😞  The only way it seems to work for me is to manaully add the user command script (through the "Settings -> Options -> Extensions -> User Commands" dialog) and then manually saving the desktop ("Settings -> Options -> Save As..." dialog)  What am I doing wrong? Help!
 
Thanks!  Julia
0 Kudos
Message 1 of 2
(3,388 Views)

Hi Julia,

Why don't you instead steal a page from the "DirectoryMenus" and insert your

Call ScriptCmdAdd(FilePathAndName.VBS)

line into the "...\DIAdem\AddInfo\ScriptDefault.VBS" file?  There are functions in the DirectoryMenus library which you already have registered that will even do this for you.  Look into the "Create DirectoryMenu.VBS" script for clues...

Ask if you need further hints,
Brad Turpin
DIAdem Product Support Engineer
National Instruments

0 Kudos
Message 2 of 2
(3,372 Views)