-
Mar 15th, 2021, 02:12 PM
#1
Thread Starter
New Member
Pass all arguments into array VBS
0
I want to run jsx script and passing argument into array
Code:
Const psNeverShowDebugger = 1, psDebuggerOnError = 2, psBeforeRunning = 3
Dim appRef
Set appRef = CreateObject("Photoshop.Application")
Dim infosDoc
infosDoc = Wscript.arguments()
Dim JSXFile
JSXFile = Wscript.arguments(0)
appRef.DoJavaScriptFile "C:\Program Files\Adobe\Adobe Photoshop 2020\Presets\Scripts\"+JSXFile+".jsx", Array(infosDoc), psNeverShowDebugger
Im getting the first argument in JSXFile but not getting all arguments in infosDoc so im a bit confuse, if someone can help me!
Thanks you!
-
Mar 18th, 2021, 04:55 AM
#2
Re: Pass all arguments into array VBS
Hi WellPlayed,
Welcome to the forum. Your post is hard to understand and I am not sure what you're asking. But, after some testing I found that "infosDoc = Wscript.arguments()" should cause an error. Are you using "On Error Resume Next"?
To get all arguments passed to your vbscript in a string you could use this code:
Code:
Option Explicit
WScript.echo(GetArguments)
Function GetArguments()
Dim Argument
Dim Arguments
Arguments = vbNullString
For Each Argument In WScript.Arguments
Arguments = Arguments & " " & Argument
Next
GetArguments = Trim(Arguments)
End Function
yours,
Peter Swinkels
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|