3 Replies Latest reply on Feb 22, 2016 9:47 AM by Bill McLean

    How to pass path strings as arguments to applescript?

    Bill McLean

      From InDesign Extend script, I have the code snippet:



        var docFolder = currentDoc.filePath.getRelativeURI("/");

        var scriptPath = (new File($.fileName).parent.getRelativeURI("/"));

        var script = new File(scriptPath + "/RunFileMaker.scpt");


        var argArray = new Array();



        if (script.exists){

           app.doScript(script, ScriptLanguage.applescriptLanguage, argArray);


      My RunFileMaker.scpt applescript has been simplified to:

      on run {argv}

           display alert item 1 of argv

      end run

      I am getting the error:


      <<script>> can make item 1 into type string

      The gist of the problem is that I am trying to pass a path string to the applescript.