3 Replies Latest reply on Sep 10, 2015 5:39 AM by frameexpert

    Can I access the File > Open location

    frameexpert Level 4

      In InDesign CS6, I choose File > Open and the default location is a folder that I have been working in from InDesign. Is there a way to access this "current location" via JavaScript? I want to prompt the user for a folder with selectDlg(), and I want to use the "current location" as the pre-selected folder. Thank you in advance. -Rick

        • 1. Re: Can I access the File > Open location
          Laubender Adobe Community Professional & MVP

          Hi frameexpert,

          I hope, I get you right.

          Do you mean you'd like to start out from the folder the active document was saved to?

           

          //Select a folder. Start with the folder of the active document:
          if(app.documents[0].saved){
             
              var myCurrentFolder = Folder(File(app.documents[0].fullName).path);
              var myResultFolder = myCurrentFolder.selectDlg("Select a folder:");
              $.writeln(myResultFolder);
             
              };
          

           

          Depending on what you like to do, you should add a string to the result: +"/"

          If the file was never saved, there is no current folder yet.

           

          Rereading your post: Maybe I'm wrong with what you like to do.

          If you start InDesign and no file is open, I think you'll get always the last accessed folder where you saved a document before quitting the app. But I'm not sure.

          I have too much versions of InDesign installed on my Mac and I lost track of that specific behavior.

           

          Uwe

          • 2. Re: Can I access the File > Open location
            Laubender Adobe Community Professional & MVP

            Hm,

            you could write a log file every time a document is saved and access that log with selectDlg() where the saved paths are written to.

            That would require a startup script and an eventlistener with AFTER_SAVE and/or AFTER_SAVE_AS.

             

            Uwe

            • 3. Re: Can I access the File > Open location
              frameexpert Level 4

              When you launch InDesign, but don't have any documents open, and choose File > Open, InDesign defaults to some folder that you used previously. I am trying to figure out if this "default folder" is stored in some property. It doesn't appear that it is. For example, FrameMaker has an OpenDir property which gives you the last folder that was accessed by FrameMaker. Your suggestion may be worth trying. Thank you for the reply.