Skip to main content

Script - front end

Hi Brian,
I would like to build a script front end, as I have created a major script with lots of minor script each referring to a specific audit testing, where before runnig everything the user is requested to select some or all analysis to perform and also in which order. Have you ever created something like this? In case, would you like to share with me some guidance or advice? I have never created one. 
Thanks, Giorgia

Brian Element Fri, 03/25/2016 - 06:56

Hi Giorgia,

Here is one suggestion for you.  As you have already created all the individual scrips you now need a "menu" script to wrap everything together and control the use of the minor scripts.  So what you can do is create a menu listing the individual tests, probably using checkboxs.  Then your menu script would call the individual scripts using RunIDEAScript, RunIDEAScriptEX or RunIDEAScriptRV depending on whether you need to send variables between scripts.  Unfortunately IDEAScript has a limit of four variables and it can't send arrays, so if you do have more than four arrays I put them in a text file that would then be read by the called script.  Once the script is complete it would return to the menu script and perform the next test.

Hope this helps a bit.

Brian

giorgia.basso Fri, 04/22/2016 - 08:20

Hi Brian,
thanks for the suggestion. I tried few solution with dialog box and boolean option but I am not able to build it. Boolean options always give me hard time.
Thanks for the help anyway.
Giorgia

Brian Element Fri, 04/22/2016 - 14:19

In reply to by giorgia.basso

Hi Giorgia,

Here is some example code for you that might help out.  

Brian

Begin Dialog dlgAuditTest 7,24,150,150,"Audit Test Demo", .NewDialog
  OKButton 13,91,40,14, "OK", .OKButton1
  CancelButton 15,113,40,13, "Cancel", .CancelButton1
  CheckBox 10,8,40,14, "Audit Test 1", .CheckBox1
  CheckBox 10,27,40,14, "Audit Test 2", .CheckBox2
  CheckBox 10,46,40,14, "Audit Test 3", .CheckBox3
  CheckBox 10,67,40,14, "Audit Test 4", .CheckBox4
End Dialog
Option Explicit
Dim bAuditTest1 As Boolean
Dim bAuditTest2 As Boolean
Dim bAuditTest3 As Boolean
Dim bAuditTest4 As Boolean

Sub Main
	Dim dlg As dlgAuditTest
	Dim button As Integer
	button = Dialog(dlg)
	bAuditTest1 = dlg.CheckBox1
	bAuditTest2 = dlg.CheckBox2
	bAuditTest3 = dlg.CheckBox3
	bAuditTest4 = dlg.CheckBox4
	If button <> 0 Then 'not cancelled
		If bAuditTest1 Then
			MsgBox "Audit test 1 was selected"
		End If
		
		If bAuditTest2 Then
			MsgBox "Audit test 2 was selected"
		End If
		
		If bAuditTest3 Then
			MsgBox "Audit test 3 was selected"
		End If
		
		If bAuditTest4 Then
			MsgBox "Audit test 4 was selected"
		End If
	end if
End Sub

 

giorgia.basso Thu, 04/28/2016 - 11:36

Hi Brian,
Thanks a lot, this helped me. Now the only issue I am facing is the following error message on the script name Invalid Macro File Name, but I using the same pattern as the one in the IDEA guidance.
Client.RunIDEAScript "PRO_003_00.ism"
Do you have any IDEA why it flag me this?
Thanks,
Giorgia
 

giorgia.basso Thu, 04/28/2016 - 12:08

I stored in the macro folder of the project I am running. I added the folder path and now is it's working :-)
Client.RunIDEAScript "Macros.ILB\1. Import multiple files.ism"
Thanks a lot,
Giorgia