DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

saving script file programmatically

Hi,

I working with DiaDem through the OLE interface object and would like to be able to save a vbs file programmatically. So far I have discovered functions to programmatically save and load DAC, LAYOUT, and REPORT files, but have only found a function to load script files.

If anyone knew how to save scripts programmatically I would be very thankful.

-Luke
0 Kudos
Message 1 of 3
(3,025 Views)

Hi Luke

Saving script files are a litle bit tricky, because you have to enter the index of the tab in the Index. Use the command (maybe this command is not available in previous versions)

AutEdTabSave
Saves a file that is open in the script editor.

Call AutEdTabSave(AutEdTabIndex, [AutEdTabName])

The following example opens the dialog box for saving files. If you close the dialog box with OK, the example runs a loop that checks which index the active file has and saves the file under the selected name.

Dim intLoop
Call AutEdInfoGet
FileDlgName = AutEdName
Call AutEdSaveAsDlg(FileDlgName)
intLoop = 0
If DlgState = "IDOk" Then
  Call AutEdTabNameGet(intLoop) 
  Do While intLoop < AutEdNoFiles And AutEdTabName <> AutEdName
    intLoop = intLoop +1
    Call AutEdTabNameGet(intLoop)
  Loop
  Call AutEdTabSave(intLoop,FileDlgName)
End If
Hope this helps.
Winfried
0 Kudos
Message 2 of 3
(3,019 Views)
Thank you. That works perfectly. Now that you have given me that function, I see that it of course is also referenced in the help. I don't know why I couldn't find it.
0 Kudos
Message 3 of 3
(3,016 Views)