Copy link to clipboard
Copied
How do I write this so AI does not show error messages if nothing is selected?
var aDoc = app.activeDocument;
app.userInteractionLevel.DONTDISPLAYALERTS
var myLayer = "";
//Unite BACK TEXT selection
selection = null;
try {
(aDoc.layers.getByName("BACK TEXT"));
var myLayer = aDoc.layers.getByName("BACK TEXT");
myLayer.hasSelectedArtwork = true;
app.executeMenuCommand("outline");//AI message: "Can't create type outlines."
app.doScript("Unite", "AI Actions_KM");//AI message: "The filter produced no results."
} catch (e) {
//alert here
}
selection = null;
I tried: "app.userInteractionLevel.DONTDISPLAYALERTS" but it had no effect.
Thanks.
Sended from phone
if ( app.selection.length > 0 ) {
alert ("selected");
}
else {
alert ("nothing is selected");
}
Have fun
![]()
Copy link to clipboard
Copied
Sended from phone
if ( app.selection.length > 0 ) {
alert ("selected");
}
else {
alert ("nothing is selected");
}
Have fun
![]()
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more