I've got a vbscript (x.vbs) that's supposed to be run from the expedition keyin toolbar:
But how do I access the command line parameters (1 2 3 in this case) from within the script?
Lots of Greetings!
Actually, when using Key-in, mgcscript is not needed: eg "run RunGerber.vbs 1 2 3", as long as RunGerber.vbs uses ScriptHelper.
You have to use WScript.Arguments. you can test following script
Set CommandLine = WScript.Arguments
If CommandLine.Count <> 0 Then
For I = 0 To CommandLine.Count - 1
Temp = Temp & IIF(Left(CommandLine.Item(I),1) = """","","""") & CommandLine..Item(I) & IIF(Right(CommandLine.Item(I),1) = """","","""") & vbCrLf
Function IIF(tf,T,F) ‘Becaue VBS have no IFF function like VB
If tf Then IIF = T Else IIF = F
There is no wscript object in a vbs file that runs in ExpeditionPCB.
try ScriptHelper (script must be called with mgcscript)
Dim args, app, docObj, jobName, jobConfigPath
Set args = ScriptHelper.Arguments
If args.Count = 3 Then
' Call from command line
' mgcscript RunGerber.vbs [job name]
jobName = args.item(3)
' Call from Expedition
Set app = GetObject(, "MGCPCB.ExpeditionPCBApplication")
Set docObj = GetLicensedDoc(app)
jobName = docObj.FullName
This will be used heavily.
Thanks a whole lot! :-)
set args = ScriptHelper.Arguments
is worked for me
Sorry. It's sad that keyin windows can't support to read command parameter.
Works great for me! That's what I'm looking for to control Keybinding-Tab to switch layer ... (not only a simple cl 1 ... )
There is a user programable keybinder in AATK and there is a layer control as well.
Retrieving data ...