2 Replies Latest reply on Jul 28, 2013 12:14 PM by artCraft2

    Find indesign doc Path and continue next

    artCraft2

      Hi Forum,

       

      I have a small thing to function over...

       

      I want to check if the indesign document is saved inside the path "/INDD_Jobs" and then proceed checking color Else alert and exit..

       

      IndFol=Folder(("/Volumes/artCraft/Livejobs/Dingy/"+[here the folder name varies]+"/INDD_Jobs").parent);

      eg.

      IndFol=Folder(("/Volumes/artCraft/Livejobs/Dingy/"+123+"/INDD_Jobs").parent); // highlighted blue is the place where indesign doc is stored.

      IndFol=Folder(("/Volumes/artCraft/Livejobs/Dingy/"+456+"/INDD_Jobs").parent); //highlighted red is the folder before INDD folder which will vary.

       

       

      var mDoc = app.activeDocument;

      IndFol=Folder(("/Volumes/artCraft/Livejobs/Dingy/"+[here the folder name varies]+"/INDD_Jobs").parent);

      ky = IndFol.path + "/" + IndFol.name;

          currentPath = mDoc.filePath;

          if(currentPath ==ky.filePath)

      {

        

         

      do something.............

                  }

       

      else{

      alert ("WARNING:" + "\r" + "FILE SAVED IN WRONG LOCATION" + "\r" +  mDoc.filePath.fsName +"\r" + "\r" +"\r" +"SAVE TO" + "\r" +IndFol.filePath), exit();

      }

       

      Please help me to do this...

        • 1. Re: Find indesign doc Path and continue next
          artCraft2 Level 1

          Hi Forum

           

          Because often I use to work on destop or downloads, i forget to save on a particular path...

           

          So the alert is needed to convey the document is not in path.

           

          atleat if it could check the path up to here, is ok

           

          "/Volumes/artCraft/Livejobs/Dingy/"

           

          thanks forum..

          • 2. Re: Find indesign doc Path and continue next
            artCraft2 Level 1

            Hi Forum,

             

            Could i able to find document path like this..

             

            eg. if myfile path is.

             

            "~D:\artCraft\Livejobs\01/23/23344\Dingy\" (pc machine)

             

            can we compare file path using any alphabets and any digits.

             

            var letterNumber = "^~[0-9a-zA-Z]:\\[0-9a-zA-Z]+$\\"+"\\^[0-9a-zA-Z]+$\\" + "\\^[0-9a-zA-Z]+$\\"+ "\\^[0-9a-zA-Z]+$\\"; 

            var path = app.activeDocument.filePath +"\\" + app.activeDocument.name;

            if((path == letterNumber)) 

              { 

            alert ("found path")

            }

             

            Please help....