Delete empty picture boxes with specific Object Style applied
Hi,
I am looking for an Indesign .jsx script that...
1) Finds all picture boxes in the active document with a certain Object Style applied to them.
2) Then finds all of the above that are empty (ie have no image inside), then deletes them.
Something like this (my apologies for the rubbish attempt at Javascript, I don't know it!)...
// create a variable for finding all objects with the Object Style called "Delete If Empty"
var MyObjectStyle = app.findObjectPreferences.appliedObjectStyles = "Delete If Empty";
// write an if statement so if the frames are empty, delete them
if (MyObjectStyle.GraphicFrame.length < 0;) {
MyObjectStyle.GraphicFrame.delete;
}
Any help would be most appreciated,
Thank you 🙂
