1 Reply Latest reply on May 7, 2010 4:22 AM by Muppet Mark-QAl63s

    How to get only the graphics path without graphics names?

    Praveen10 Level 1

      Hi All,

       

      I need to get only the graphics path without graphics names like 'd:\Images\' instead of 'd:\Images\abc.jpg' in JS.

       

      Thanks,

       

      Praveen

        • 1. Re: How to get only the graphics path without graphics names?
          Muppet Mark-QAl63s Level 4

          Something like this should get you close…

           

          #target indesign
          
          function main() {
               if (app.documents.length == 0) {
                    alert('Please have an "Indesign" document before running this script.');
               return;
               }
               docRef = app.activeDocument;
               with(docRef) {
                    var x = rectangles[0].allGraphics[0].itemLink.filePath;
                    var y = new File(x).parent.fsName;
                    $.writeln(y);
               }     
          }
          
          main();