Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

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

Guest
Mar 04, 2010 Mar 04, 2010

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.

TOPICS
Scripting
498
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Mar 04, 2010 Mar 04, 2010

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Mar 04, 2010 Mar 04, 2010
LATEST

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines