Running a Script
To run a script from the Project Manager:
- In the Project Manager Definitions > Scripts folder, right-click on the script you want to run to open the context menu.
- Select Run Script.
To run a script from Maxwell:
- Click Tools > Run
Script.
- In the Open dialog box that appears, use the file browser to locate the folder in which you saved the script, and then double-click the folder's name.
- Type the name of the script in the File name text box, or click its name,
and then click Open.
Maxwell executes the script.
AnsoftScriptHost.arguments
collection
from vbscript
. This is a standard COM collection.To run a script form a command line:
- Type one of the following command line options at the command line:
-runscriptandexit or -runscript
- Press Enter.
You can also pass the -scriptargs
parameter to the script and specify arguments.
vbs
directly, or use wscript.exe
or cscript.exe
), the
arguments will be in the WSH.arguments
collection, not the AnsoftScriptHost.arguments
collection. To handle this, write the following:
on error resume next
dim args
Set args = AnsoftScript.arguments
if(IsEmpty(args)) then
Set args = WSH.arguments
End if
on error goto 0
'At this point, args has the arguments no matter if you are running
'under windows script host or Ansoft script host
msgbox "Count is " & args.Countfor i = 0 to args.Count - 1
msgbox args(i)
next