Skip to main content
Known Participant
Mar 1, 2019 9:32 PM UTC
Question

Block Messages From Framemaker

I have developed a script that converts ditamaps into framemaker books.  Due to the size and number of books to be created this script must run overnight.  Seemingly randomly framemaker creates a popup message that warns me it doesn't know where referenced images files are located and that the images will appear as grey boxes.  This popup prevents the script from running until someone clicks the "ok" button, at which point it will resume.  Is there a way to prevent framemaker from generating these popups?

This topic is closed to new replies. Start a new post to keep the conversation going.

34 replies

Participating Frequently
Jul 25, 2023 3:44 AM UTC

Hi, gabeS1234
You can use the following functions (Notification (), Notify (), ReturnValue ()) to handle alert dialogs.

Notification (Constants.FA_Note_Alert, true);
function Notify (note, object, sparam, iparam){
	switch (note){
		case Constants.FA_Note_Alert:
			// handle errors as needed
			Console ("object: " + object);
			Console ("sparam: " + sparam);
			ReturnValue (Constants.FR_CancelOperation);
			break;
	}
}

Use the following code at the end of your script to dismiss the notification.

Notification (Constants.FA_Note_Alert, false);

 

Translate
Participating Frequently
Jul 25, 2023 3:50 AM UTC

I didn't realize the thread had a second page.
Sorry for the duplicate answers.

Translate
4everJang
Legend
Mar 2, 2019 7:17 AM UTC

When your script is opening files, you are using the Open method with a set of open parameters. There are various parameters that tell FrameMaker not to resolve references, not to complain about missing fonts etc. You shoud make sure all those options are set such that nothing can stop your process. Use the FDK Reference Guide - look for GetOpenDefaultParams( ) - to find the full list. I have copied the ones that may cause unwanted blocking messages. I am just naming the param ident names and the values to set. You know how to handle an array of PropVals (otherwise you would not have your script open files at all).

FS_FileIsOldVersion -> FV_DoOK

FS_FontChangedMetric -> FV_DoOK

FS_FontNotFoundInCatalog -> FV_DoOK

FS_FontNotFoundInDoc -> FV_DoOK

FS_LanguageNotAvailable -> FV_DoOK

FS_LockCantBeReset -> FV_DoOK

FS_RefFileNotFound -> FV_AllowAllFilesUnFindable

FS_UpdateXRefs  -> FV_DoNo (this could make your process a LOT faster, and I am guessing your XRefs will either have to be re-created or updated by your script, or remain as they are).

I hope this helps.

Translate
gabeS1234Author
Known Participant
Mar 5, 2019 2:19 PM UTC

function openXmlFile(filePath) { 

    var file = File(filePath);

    var fileName = file.fsName;

    var openParams, i;

    openParams =  GetOpenDefaultParams();

   

   

   i = GetPropIndex(openParams, Constants.FS_RefFileNotFound);

    openParams.propVal.ival = Constants.FV_AllowAllRefFilesUnFindable;       

    i = GetPropIndex(openParams, Constants.FS_FileIsOldVersion);

    openParams.propVal.ival = Constants.FV_DoOK;

    i = GetPropIndex(openParams, Constants.FS_FontChangedMetric);

    openParams.propVal.ival = Constants.FV_DoOK;  

    i = GetPropIndex(openParams, Constants.FS_FontNotFoundInCatalog);

    openParams.propVal.ival = Constants.FV_DoOK;   

    i = GetPropIndex(openParams, Constants.FS_FontNotFoundInDoc);

    openParams.propVal.ival = Constants.FV_DoOK;   

    i = GetPropIndex(openParams, Constants.FS_LockCantBeReset);

    openParams.propVal.ival = Constants.FV_DoOK;       

    i = GetPropIndex(openParams, Constants.FS_FileIsInUse);

    openParams.propVal.ival = Constants.FV_OpenViewOnly;     

    i = GetPropIndex(openParams, Constants.FS_UpdateXRefs);

    openParams.propVal.ival = Constants.FV_DoNo; 

   

   

    var retParams = new PropVals();

    var doc = Open(fileName, openParams, retParams);

    return doc; 

}

This is my current file opening function updated with your suggested open params.  However I'm still randomly getting this error message:

Is there anyway to block user interaction entirely in extendscript like I can when writing scripts for Adobe Illustrator?

Translate
frameexpert
Community Expert
Community Expert
Mar 5, 2019 2:58 PM UTC

Yes, this message is very annoying and there is no way to suppress it as far as I know. What are you doing after you open the files? You can open a file invisibly so it doesn't display on screen and still work on it programmatically. That would prevent that message from appearing.

Translate
www.frameexpert.com