2 Replies Latest reply on Mar 4, 2010 11:38 PM by FlexMitchell

    How to get documnet fullName, if the documnet opened by user

    FlexMitchell

      In Indesign 2.0 , after user opened a dcument, we could use Activedocumnet.FullName to get the full path filename, however,

      it is imposible in Indesign CS4, it raises an error: can get FullName  before doucment is saved.

      Is anybody have ideas to get  FullName in such case?

       

      Mitchell Hu

      P.S: my English ability is poor, I translated the error messge form Chinese to English. So, hope you could understand it.

        • 1. Re: How to get documnet fullName, if the documnet opened by user
          Shonkyin Level 3

          If you have an Untitled document then you can't get its full name. Your file must be saved at least one time if you want get full name of document.

           

          In CS4 Javascript you can get document full with below code:

           

          app.activeDocument.fullName

           

           

          Shonky

          • 2. Re: How to get documnet fullName, if the documnet opened by user
            FlexMitchell Level 1

            Thanks Shonkyin.

            But my requirement is while User run CS4 then open any existed document(saved before).'

            After that, start running a scritpt

            like app.activeDocument.fullName

            Actually my script is a Delphi program.

            Part code as below( much like script):

             

             

              bsInDesign := CreateOleObject('InDesign.Application.CS4');

              bsInDesign.ViewPreferences.VerticalMeasurementUnits:=2053991795;

              bsInDesign.ViewPreferences.HorizontalMeasurementUnits:=2053991795;

              bsInDesign.LayoutWindows.item(1).TransformReferencePoint:= 1095660652;

              bsInDoc := bsInDesign.ActiveDocument; <------this part would get the xxxx.indd opened by user manually before this program start running.

              showmessage(bsInDoc.FullName);<======= error message raise here : can not get FullName , because the document do not saved.

             

             

            So, my requirement is : allow user open any existed and saved xxxxxx.indd.

            Then, my program according to this opened xxxxx.indd to get its FullName.

            In Indesign 2.0 scrpit  showmessage(bsInDoc.FullName); works fine.

             

            How come this will get a strange error in Indesing CS4.

            It is an unreasonable error.