Copy link to clipboard
Copied
Dear all
I see how to create a new book-component,
var comp = book.NewSeriesBookComponent(0); comp.Name = "C:\\SomeDocumentPath";
but all I want is creating a new independent FM-document, write something to it, (which i have collected from the docs of a book or a singualer doc).
Any ideas?
Thank You
To create a document, you only have to open it:
ADOBE FRAMEMAKER SCRIPTING GUIDE says:
Open
Description
Opens a document or book. It can also create a new document.
Open() allows you to specify a property list telling FrameMaker how to open or create the file and how to deal with error and warning conditions.
For example, you can specify whether to abort or to continue opening a document if it contains fonts that are not available. If the file is already open and invisible, it will make the file v
...Copy link to clipboard
Copied
To create a document, you only have to open it:
ADOBE FRAMEMAKER SCRIPTING GUIDE says:
Open
Description
Opens a document or book. It can also create a new document.
Open() allows you to specify a property list telling FrameMaker how to open or create the file and how to deal with error and warning conditions.
For example, you can specify whether to abort or to continue opening a document if it contains fonts that are not available. If the file is already open and invisible, it will make the file visible.
Hope that helps
cu
Klaus
EDIT:
Here's an example:
var openParams, openReturnParams; | |
openParams = GetOpenDefaultParams(); | |
openReturnParams new PropVals(); | |
var MyFile = "C:\\MyPath\\MyFile.fm"; | |
oFile = Open(MyFile,openParams, openReturnParams); | |
And if you want to change the parameters:
var openParams, openReturnParams; |
openParams = getYourParams (); |
openReturnParams = new PropVals(); |
var MyFile = "C:\\MyPath\\MyFile.fm"; |
oFile = Open(MyFile,openParams, openReturnParams); |
function getYourParams() {
var params, i; |
/* | |
Change the params | |
*/ | |
i = GetPropIndex(params, Constants.FS_RefFileNotFound); | |
params.propVal.ival = Constants.FV_AllowAllRefFilesUnFindable; |
i = GetPropIndex(params, Constants.FS_FileIsOldVersion); |
params.propVal.ival = Constants.FV_DoOK; |
i = GetPropIndex(params, Constants.FS_FontNotFoundInDoc); |
params.propVal.ival = Constants.FV_DoOK; |
i = GetPropIndex(params, Constants.FS_LockCantBeReset); | |
params.propVal.ival = Constants.FV_DoOK; |
i = GetPropIndex(params, Constants.FS_FileIsInUse); | |
params.propVal.ival = Constants.FV_OpenViewOnly; |
i=GetPropIndex(params,Constants.FS_AlertUserAboutFailure); |
params.propVal.ival=Constants.FV_DoCancel;
i=GetPropIndex(params,Constants.FS_MakeVisible ); |
params.propVal.ival=false; |
return (params); |
}
Copy link to clipboard
Copied
Hello Klaus,
During the weekend I had the same idea.
Opening a template file provides full blown style definitions etc. In my case I will add the template to the script directory (where I anyway have an ini-file also). The filled up file will then be stored to the location of the source files.