Skip to main content
Known Participant
July 11, 2024
Question

InDesign 2024 crash while opening a document which uses a custom C++ plugin

  • July 11, 2024
  • 2 replies
  • 564 views

Hi,

 

We have a document that causes InDesign to crash while opening. This document uses our custom C++ plugin.

 

With the debug version of InDesign following prompts are shown before InDesign crashes

 

 
The only way to resolve the issue is to remove the PrePress plugins from InDesign
 

 

With this, after a lot of prompts, the document ultimately opens without crashing InDesign.
 
I do not understand the issue here and how to go about troubleshooting it.
 
Please advice.
 
Thanks

 

 

This topic has been closed for replies.

2 replies

Community Expert
July 19, 2024

Hi @asaxena ,

if you are able to open the document without a layout window, you could export to IDML, open the IDML file and save it to a new named document.

 

ExtendScript code below, read also into my comments in the code:

// To avoid messages set the user interaction level to "Never interact":
app.scriptPreferences.userInteractionLevel = UserInteractionLevels.NEVER_INTERACT ;

var getINDDFile = File.openDialog
(
	"Open InDesign File" ,
	"*.indd",
	false
);

if( getINDDFile == null )
{
	alert( "NO INDD FILE SELECTED." );
	// Reset script preferences:
	app.scriptPreferences.userInteractionLevel = UserInteractionLevels.INTERACT_WITH_ALL ;
	exit();
};

// Open INDD file WITHOUT a layout window:
app.open( getINDDFile , false );

var doc = app.documents[0];
var docFilePath = doc.filePath;

var idmlFileName = doc.name.replace(/\.indd$/ , "-IDML.idml" );
var idmlFile = File( docFilePath +"/"+ idmlFileName );

// Export doc without layout window to IDML:
app.documents[0].exportFile( ExportFormat.INDESIGN_MARKUP , idmlFile );

// Close original document without saving:
app.documents[0].close( SaveOptions.NO );

// Open exported IDML file without a layout window:
app.open( idmlFile , false );

var newDocName = idmlFileName.replace( /\.idml$/ , ".indd" );
var newDocFile = File( docFilePath +"/"+ newDocName );

app.documents[0].save( newDocFile );
app.documents[0].close( SaveOptions.NO );

// Resetting the script preferences:
app.scriptPreferences.userInteractionLevel = UserInteractionLevels.INTERACT_WITH_ALL ;

alert( "Done" );

Code tested with InDesign 2024 version 19.5.0.84 on macOS.

No idea, if that will help in your case.

 

Regards,
Uwe Laubender
( Adobe Community Expert )

 

Legend
July 16, 2024

Sounds like that UID is supposed to refer to a preflight profile, Could be the active prefilght profile that is exercised on load unless you disable preflight that hard way removing its plugin?

 

Not being able to get the class ID means there is no such object, it was deleted,

Legend
July 16, 2024

What happens if you open the doc without UI – so the preflighting task does not kick in – (by script) and create+assign a different preflight profile?

asaxenaAuthor
Known Participant
July 19, 2024

Please suggest how to open the doc without UI (by script)

In the meanwhile, I opened a new document and set the preflight to off. Then I opened the original document and InDesign crashed again.