Wednesday, February 22, 2012

Opening a File with User Interaction

The easiest way to open a file is with SimpleOpen(). This is the analog to SimpleSave() discussed here.

If you do the open interactively, you do not need to know the file's location. You simply let the user locate the proper file.

The following script passes an empty string for the fileName parameter. FrameMaker assumes the file is the last one opened.

var doc;
doc = SimpleOpen("", true);


To open a file without user interaction, you need to pass it is full pathname and false for the second parameter. 

2 comments:

  1. Hello
    First of all great work.
    Second i need a script that open files from a directory and saves them in an older version.I saw you have a code to save a file in an older version but i need to save in 7 and it doesn't work(works fine in 9,8).
    Thanks

    ReplyDelete
  2. Hi,

    Try saving the file as MIF. You may find you can open it in version 7. Do a manual test before you write any code.

    Best of luck.

    Debra

    ReplyDelete