2 Replies Latest reply on Jan 15, 2011 3:00 PM by mohitunlimited

    Dialog box works in script but unable to hard code path

    mohitunlimited

      I am writing a script to read xml document and convert it to pdf.

      When I try to get path by opening dialog box ..it is working...

       

        var xmlFile = File.openDialog("Select Document XML File");

       

          if (xmlFile == null || xmlFile.name.length < 4)

            {

            alert("Invalid File");

            return;

            }   

       

      This above code is working

       

      But when I try :

       

          var xmlFile = '/c/xyz/abc.xml';

       

          alert(xmlFile);

        if (xmlFile == null || xmlFile.name.length < 4)

            {

            alert("Invalid File");

            return;

            }   

      It pops out error

      There error says:

       

      Error Number : 21

      Error String : undefined is not an object

       

      Line 105:

      Source :if (xmlFile == null || xmlFile.name.length < 4)

       

      Can anybody help me with this.?