Calling an ExtendScript script from the command line

Hi! I can call an ExtendScript script from a command line just by using its path, but is there a way to pass parameters to the script? Thanks. -Rick

Hi Rick,
Well, a scan of the documentation certainly provides no evidence of this capability. If it exists, someone else will have to fill us in.
I did have an idea, although it's a bit of a roundabout approach. A windows batch file can accept parameters and can write a text file. So, maybe Mif2Go can call a batch file instead that writes the folder to some file, then runs the script that reads the file. Although, I'm not familiar with a command line call to ES, so I'm not sure that a batch file can launch an ES script too. If not, can Mif2Go make more than one command line call?
Russ

Similar Messages

  • Running a function from a powershell script from the command line

    Rather than creating several scripts each with one function, I have one script with has several functions.... I would like to call the script and select the function i want to use from the command line.
    so far, if i change directory to that of the script i can call the function by doing this:
    cd c:\myscripts
    . .\mytestscript.ps1; myfunction
    this works fine.... i have also tried, what I would like to achieve is calling it like this
    c:\myscripts\mytestscript.ps1; myfunction
    however, i am trying to run this as part of an MDT task sequence, my command line looks like this and using the ; myfunction at the end doesn't work.
    powershell.exe -ExecutionPolicy Bypass %SCRIPTROOT%\CustomScripts\mytestscript.ps1; myfunction
    how can i adapt my command line so that it will successfully call the function within my script?
    thanks
    Steve

    Rename the file from ps1 to psm1 and create a powershell module that contain multiple functions. A module will autoload like the built-in modules.
    Placement of the psm1 file is important for Powershell to find and autoload it.
    The file name and folder name must be the same, for example MyModule.psm1 should be in the folder:
    user\documents\windowspowershell\modules\mymodule
    Windows PowerShell Modules
    http://msdn.microsoft.com/en-us/library/dd878324(v=vs.85).aspx
    PS C:\> get-childItem env:PSModulePath
    Name Value
    PSModulePath C:\Users\User\Documents\WindowsPowerShell\Modules;C:\Windows\system32\WindowsPowerShell\v1.0\Modules\

  • How to execute SAPGUI script from the command line?

    I have created a script and would like to execute it from the command line. There must be some flag that goes with SAPGUI.EXE. Any help appreciated.
    Thanks,
    Jeff

    Hi Jeff,
    the best way to do this is to run the script using the Windows Script Host, for example like this:
    cscript myscript.vbs
    This will execute the script which in turn can access SAP GUI. You may however have to make sure the script attaches to the correct session.
    Best regards,
    Christian

  • Is there a way to generate job execution scripts from the command line?

    The customer is planning to change DI production server configuraiton and needs to regenerate job execution scripts for hundreds of jobs. Their question is - instead of going through web admin and doing it one by one, is there a way to run a batch command and generate all jobs with the same job server information from one repository? I looked at the "al_engine" command but didn't find the options to do so. Did I miss something? This is for a DI 11.5.3 on HPUX.
    Thanks,
    Larry

    I also suggested that but the customer was so afraid of messing things up that they wanted to find out if there is another way. Thanks a lot for the confirmation.
    Larry

  • Run javascript (not in a jsx file) from the command line extendscript

    Hi all,
    I was wondering if anyone knew how to run javascript from the command line in Extendscript (meaning Extendscript would be the target application). I know about the -run command line flag in which allows you to run a .jsx script from the command line but what I'm looking for similar syntax to run a script directly without needing to put it in a file. For example I have tried (obviously unsuccessfully):
    C:\Program Files (x86)\Adobe\Adobe ExtendScript Toolkit CC\ExtendScript Toolkit.exe -run "alert('Hello World');"
    Thanks!

    You might be looking for something like this: javascript - Is it possible to execute JSX scripts from outside ExtendScript? - Stack Overflow
    Although that one is about executing JSX files, the solutions given (Applescript as well as COM/VBScript) can be adapted to simply run a javascript code snippet rather than JSX file because the solutions simply call the Adobe app's Applescript/COM API to "execute javascript" (actually execute ExtendScript technically), and in the solution, they using includes to pull in the JSX file. You'd simply replace the include with actual javascript code snippet inserted in.
    Though this would then require you to run a VBScript, Applescript, or other script (that calls the COM/Applescript API) rather than the ESTK command line option.

  • Is there a way to switch between workspaces in Spaces from the command line?  I want to write a script to set up certain applications in certain workspaces (without having to do it manually each time)...

    Is there a way to switch between workspaces in Spaces from the comnand line?  I use several workspaces from Spaces, each workspace having a certain number of fixed applications running.  Rather than set all this up each time I log on, I'd like to write a script from the command line (I use gawk) to automate this. Currently I have a gawk script that, given a directory, opens a few xterms whose working directory is the given directory, and opens "preview" applied to a certain file in that directory.  However, at present I have to manually move an xterm through each workspace and run my gawk script in each workspace (applied to each directory that I'm working on).
    There must be a better way...

    Addendum: Can this be done via:   open -a Spaces --args xxx  , where xxx is some set of arguments (or something like this)?

  • Is it possible to script Firefox to do things from the command line?

    Specifically, I am attempting to print a web page at a specific url from the command line.

    Thanks for the quick reply. I had already seen the page you linked to, but it doesn't have any commands to print a web page. Should I interpret from that absence that there isn't a way to print from Firefox from the command line?

  • Help required - running a Java program from the command line

    Hi,
    I have a small non-graphical Java application, packaged into a Jar file. My program relies on classes in another (external) Jar file.
    When I run the application from the IDE, everything works fine. However, when I try to run the application from the command line, I keep getting a NoClassDefFoundError for classes in the external jar.
    Both the application jar file and the external jar file are in my root directory (C:\).
    My command line call is as follows:
    java -cp c:MyExternalLib.jar -jar MyApp.jar
    Any help greatly appreciated.
    Thanks,
    Walter

    hi,
    set classpath=%classpath%;c:\myjar.jar;
    here i have specified myjar.jar file as an example u give ur location.after setting the classpath run ur java application.
    java mypgm
    this will solve ur problem
    regards,
    Ganesh

  • Get GPS location from the command line

    Is there a utility to get the current GPS location from the command line?  A quick search says `geo` will do it, but that appears to come with the android dev tools, which I'd rather not install right now.  The reason I want to do this is to avoid hard-coding my coordinates in a call to `redshift`.

    enduser wrote:
    Hmm.. `gpspipe` gives me:
    gpspipe: could not connect to gpsd localhost:2947, Unknown error -6(-6)
    And `gpsd` gives me:
    gpsd:ERROR: can't run with neither control socket nor devices
    Do I need to be root for these applications? Alternatively, could I maybe just grab the timezone from /etc/localtime and use that? (though I guess that doesn't get close enough on longitude...)
    You have to start gpsd from systemctl.  And you can plug/unplug gps devices at will, so it can be enabled in systemctl whether or not an actual gps is always available.

  • Execute script from AfterFX command line

    Hello all
    I'm trying to run a script from the AfterFX.exe command line and I get a message: "Unable to execute script at line 1. Syntax error"
    If I run the same script file from the AE Script Editor, it works perfectly
    Here is the command line I'm using:
    "C:\Program Files\Adobe\Adobe After Effects CS6\Support Files\AfterFX.exe" -noui -s "D:\Product\Watermark\Rendering\WatermarkedSecuritySample.jsx"
    Anyone have an idea of what can cause this error? I've tried running the script directly in the command line like
    "C:\Program Files\Adobe\Adobe After Effects CS6\Support Files\AfterFX.exe" -noui -s "alert('1')"
    and it works fine for short script but mine is way to big to do that
    As you can probably guess with the "Watermark" and "Security" in the filename, I cannot post the script file here, all I can say is that the line 1 is:
    var projectName = "D:\\Product\\WatermarkTemplate.aep";
    I've tried to replace the entire script with "alert('1');" and it cause the same error when running it from the command line
    Also, if anyone know where I can find the AfterFX.exe command line arguments description, I would be very happy.. everybody talks about aerender.exe but I need thoses options for AfterFX.exe
    Thanks for your help

    Have you tried to use "-r" instead of "-s"?
    (argument for "-s" is a script; and argument for "-r" is a path to script)

  • Running a jar from the command line

    I am trying to run a Jar from the command line. I have a number of classes in a package called "trainnn".
    I put all the classes into a jar
    jar cvf name.jar trainnn\*.classI then creat a file called mainClass.txt with the line (with a blank return line after it, where QueryMatch has the main). This file was placed in the same directory as the package and the jar file
    Main-Class: QueryMatch
    then
    jar cmf mainClass.txt network.jar G:/TrainNN/src/trainnn/QueryMatch.classthis worked fine.....but it is from here I have problems when I try run the jar
    java -jar network.jarbut get this error.
    Exception in thread "main" java.lang.NoClassDefFoundError: QueryMatch
    I cant figure out this error, I have tried specifying the exact path in the mainClass.txt file but that didnt work.
    Any ideas
    Thanks in advance.

    Hi,
    To start a java app in the command line with "java -jar yourJarFile.jar", the jar needs to have a mainfest file "MANIFEST.MF" in a folder called "META-INF". The manifest file would have to contain the name of your starting class, e.g. it could look like thisManifest-Version: 1.0
    Main-Class: com.yourCompany.yourProject.YourClass Hope that helps. Cheers, HJK

  • Invoking XSLT from the Command Line with JRE1.4 and JRE1.5

    When I invoke XSLT from the Windows Command Line with "java.exe org.apache.xalan.xslt.Process -IN OldFile.xml -XSL StyleSheet.xsl -OUT NewFile.xml" it worked fine with JRE1.4.
    Then I installed JRE1.5.0_09. The class "org.apache.xalan.xslt.Process" was moved to "com.sun.org.apache.xalan.internal.xslt.Process". But when I call it with "java.exe com.sun.org.apache.xalan.internal.xslt.Process -IN OldFile.xml -XSL StyleSheet.xsl -OUT NewFile.xml" I get the error "Exception in thread "main" java.lang.NoSuchMethodError: main". When I look into the Process class there is no "main", but a "public static void _main(String argv[])".
    The "JAXP Compatibility Guide for the J2SE Platform, versions 1.4 and 1.5" on "http://java.sun.com/webservices/docs/1.6/jaxp/JAXP-Compatibility_150.html" chapter "Invoking XSLT from the Command Line" claims it should work.
    Is there no more chance to invoke XSLT from the Windows Command Line? Why is "main" renamed to "_main"? Is the documentation wrong or is this a bug?

    When I invoke XSLT from the Windows Command Line with "java.exe org.apache.xalan.xslt.Process -IN OldFile.xml -XSL StyleSheet.xsl -OUT NewFile.xml" it worked fine with JRE1.4.
    Then I installed JRE1.5.0_09. The class "org.apache.xalan.xslt.Process" was moved to "com.sun.org.apache.xalan.internal.xslt.Process". But when I call it with "java.exe com.sun.org.apache.xalan.internal.xslt.Process -IN OldFile.xml -XSL StyleSheet.xsl -OUT NewFile.xml" I get the error "Exception in thread "main" java.lang.NoSuchMethodError: main". When I look into the Process class there is no "main", but a "public static void _main(String argv[])".
    The "JAXP Compatibility Guide for the J2SE Platform, versions 1.4 and 1.5" on "http://java.sun.com/webservices/docs/1.6/jaxp/JAXP-Compatibility_150.html" chapter "Invoking XSLT from the Command Line" claims it should work.
    Is there no more chance to invoke XSLT from the Windows Command Line? Why is "main" renamed to "_main"? Is the documentation wrong or is this a bug?

  • Problem with running a java program from the command line

    I have this code:
    package pkg;
    import jxl.*;
    import java.io.File;
    public class TestClass {
         public static void main(String[] args) {
              try{
                   Workbook book = Workbook.getWorkbook(new File("d:/testWorkspace/excFile.xls"));
                   Sheet sheet = book.getSheet(0);
                   String s=sheet.getCell(4, 2).getContents();
                   System.out.println(s);     
              }catch (Exception e){System.err.println(e);}
    }I've wrote it in Eclipse, added jxl.jar to the buildpath, and it works fine.
    Then I tried to run it from the command line and I did it like this:
    D:\testWorkspace\testProject\bin> java -cp \jxl.jar pkg.TestClassThe result was:
    Exception in thread "main" java.lang.NoClassDefFoundError: pkg/TestClass
    Caused by: java.lang.ClassNotFoundException: pkg.TestClass
    ...but the file TestClass.class DOES exist in the folder d:\testWorkspace\testProject\bin\pkg\ and the file jxl.jar IS on the root of drive D (like I already wrote, it worked fine inside the Eclipse).
    So, my question is: How to run this code from the command line?
    I have no idea what went wrong.
    Can someone help me, please?

    The current directory is not implied in the classpath.
    D:\testWorkspace\testProject\bin> java -cp .;d:\ pkg.TestClassor
    D:\testWorkspace\testProject\bin> java -cp .;d:\jxl.jar pkg.TestClassI always forget which is right since I never work with jars...

  • Get the absolute path and filename of the file from the command line

    Hi,
    when we run the class we give the command
    java <filename>
    How can I capture the filename given above and get its absolute path inside the
    public static void main(String [] args){}
    args[0] gives me the command line argument after the filename. How do I capture the filename itself from the command line argument and also get that files absolute path
    Thanks

    I don't know of any way to capture the java command input, but there are ways to find out where the application is being run from. (the "absolute path")
    http://forum.java.sun.com/thread.jsp?forum=31&thread=335394

  • How can I print the test page with the Arabic type from the command line

    Hi,
    I have been trying to make the tool for printing the test page from the command line on the Arabic OS. I used "rundll32 printui dll printuientry" with "/k /n" options. My tool is to print the test page in all OS when pushing the
    button.
    Normally, in the Arabic Windows, the test page is printed with RTL type when printing the test page in the "Devices and Printers". But in my tool, the test page is printed with LTR type. I'm confused because of this result.
    Is it possilbe to print the test page with RTL type when using the "rundll32 printui dll printuientry"? If it is possible, could anyone give me the hint or information for resolving?
    Please check for me.

    Hello,
    Thank you for your post.
    Your issue is out of support range of Test Tools in Visual Studio 2010 and 2012 forum which discusses Visual Studio Test issues.
    I am moving your question to the moderator forum ("Where is the forum for..?"). The owner of the forum will direct you to a right forum.
    Best regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

Maybe you are looking for