Skip to main content
Inspiring
December 11, 2012
Question

Uncaught exception on text layer with multiple justification settings

  • December 11, 2012
  • 1 reply
  • 895 views

I'm trying to figure out how to deal with an uncaught exception error when attempting to read the justification of a text layer with multiple justifications. You can tell if a layer is like this as it shows no justification setting in the Paragraph panel.

To test this, create a text layer with two lines. Use the text tool to select each separate line and set different justification settings in the paragraph panel. Deselect then reselect the layer and you should see no setting is highlighted in the paragraph panel.

Here's some example code to try on such a layer. You just need to select the Source Text property before running the script:

var activeItem = app.project.activeItem;

var textDoc = activeItem.selectedProperties[0].value;

alert(activeItem.selectedProperties[0].name + " selected - " + textDoc.text);

function errFunc(errString) {

          alert(errString);

}

app.onError = errFunc;

try {

          alert(textDoc.justification);

} catch(e) {

          alert(e.toString());

}

This seems like a bug but I'm hoping someone can suggest a workaround

Thanks.

This topic has been closed for replies.

1 reply

Dan Ebberts
Community Expert
Community Expert
December 11, 2012

I haven't been able to come up with a way to get past the uncaught exception.

Dan

Inspiring
December 13, 2012

Thanks for trying Dan.

I couldnt find any way to keep a script running through this. The best workaround I've found so far is to write an "avoid list" to a file and keep adding to it through successive script launches/failures until it's complete and the script can avoid all such text layers. Ugh!

Paul