Highlighted

Script | Selection on merged row makes indesign crash

Explorer ,
Sep 21, 2020

Copy link to clipboard

Copied

Hi everyone,

 

I'm facing a new problem with a script I was working on, it is supposed to read every cells I selected and let me apply a cell and paragraph style. It works fine unless my first selection is a merge row and the second one a row without any merge.

 

so selecting this two rows with this code makes indesign crash:

var mySelection = app.selection[0];
alert(mySelection.contents);

 

here's an example of my selection that crashes:

Capture d’écran 2020-09-21 à 18.18.06.png

either it crashes, or it shows me once in a while that error:

Capture d’écran 2020-09-21 à 17.59.03.png

I made an indd file example right here: https://www.dropbox.com/s/vwgx01jjgdd2c4n/row-issue.indd?dl=0

 

Thanks everyone,

Nicolas

Adobe Community Professional
Correct answer by Laubender | Adobe Community Professional

Hi Nicolas,

voted for a fix and commented your bug report at UserVoice.

For now it is sufficient to do one report only.

 

Important:

The more developers will vote for fixing the problem the more attention will be drawn and hopefully the bug will get fixed some day.

 

Thanks,
Uwe Laubender

( ACP )

TOPICS
Scripting

Views

96

Likes

Translate

Translate

Report

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

Script | Selection on merged row makes indesign crash

Explorer ,
Sep 21, 2020

Copy link to clipboard

Copied

Hi everyone,

 

I'm facing a new problem with a script I was working on, it is supposed to read every cells I selected and let me apply a cell and paragraph style. It works fine unless my first selection is a merge row and the second one a row without any merge.

 

so selecting this two rows with this code makes indesign crash:

var mySelection = app.selection[0];
alert(mySelection.contents);

 

here's an example of my selection that crashes:

Capture d’écran 2020-09-21 à 18.18.06.png

either it crashes, or it shows me once in a while that error:

Capture d’écran 2020-09-21 à 17.59.03.png

I made an indd file example right here: https://www.dropbox.com/s/vwgx01jjgdd2c4n/row-issue.indd?dl=0

 

Thanks everyone,

Nicolas

Adobe Community Professional
Correct answer by Laubender | Adobe Community Professional

Hi Nicolas,

voted for a fix and commented your bug report at UserVoice.

For now it is sufficient to do one report only.

 

Important:

The more developers will vote for fixing the problem the more attention will be drawn and hopefully the bug will get fixed some day.

 

Thanks,
Uwe Laubender

( ACP )

TOPICS
Scripting

Views

97

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Sep 21, 2020 0
Adobe Community Professional ,
Sep 21, 2020

Copy link to clipboard

Copied

Hi Nocalas,

interesting case!

 

I get the same error message even if I only run the following statement from the ESTK:

app.selection

 

Could be a bug with InDesign's ExtendScript perhaps.

Tested with InDesign 2020 version 15.1.2.226 on Windows 10.

 

Regards,
Uwe Laubender

( ACP )

 

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 21, 2020 0
Adobe Community Professional ,
Sep 21, 2020

Copy link to clipboard

Copied

Also happening in VS Code Extendscript Debugger, on Catalina running the latest ID. Definitely a bug with selecting merged rows. If you select the merged cell as well, it works fine. I'll play around more. 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 21, 2020 0
Adobe Community Professional ,
Sep 21, 2020

Copy link to clipboard

Copied

Also the following selection throws the error:

 

ErrorInSelectionOfCells-1.PNG

 

try
{
app.selection ;
}catch(e)
{ 
	$.writeln( "ERROR: " + e.number +", "+e.message ) ;
	alert( "ERROR: " +"\r"+ e.number +", "+e.message ) ;
};

 

Regards,
Uwe Laubender

( ACP )

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 21, 2020 0
Adobe Community Professional ,
Sep 21, 2020

Copy link to clipboard

Copied

Hi Brian,

also tested a bit:

Already an issue with InDesign CS6 version 8.1.0.

 

Regards,
Uwe Laubender

( ACP )

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 21, 2020 0
Adobe Community Professional ,
Sep 21, 2020

Copy link to clipboard

Copied

Even if I do a selection of the three cells by scripting the resulting selection throws an error.

// Text frame with table is selected:
var table = app.selection[0].tables[0] ;

// Let's do a selection of three cells:
app.select( table.columns[0].cells[1] );
// No error:
app.select( table.columns[1].cells[2] , SelectionOptions.ADD_TO );
// No error:
app.select( table.columns[1].cells[1] , SelectionOptions.ADD_TO );

// THROWS ERROR:
try
{
app.selection ;
}catch(e)
{ 
	$.writeln( "ERROR: " + e.number +", "+e.message ) ;
	alert( "ERROR: " +"\r"+ e.number +", "+e.message ) ;
};

 

ErrorInSelectionOfCells-2.PNG

 

Regards,
Uwe Laubender

( ACP )

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 21, 2020 0
Explorer ,
Sep 22, 2020

Copy link to clipboard

Copied

Good morning everyone,

 

I ran other tests but it's still crashing.

There's no reference of error number "1" on google.

I'll continue to investigate and will keep you posted if I find a solution…

 

Thanks Uwe & Brian!

Nicolas

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 22, 2020 0