// Retrieve interface: var di = this.getDocumentInterface(); // Only valid if there is an active document: if (isNull(di)) { EAction.handleUserWarning("No active document found"); return; } // Retrieve reference to the document: var doc = di.getDocument(); // Query all images in the document: var imagesIds = doc.queryAllEntities(false, false, RS.EntityImage); // Report no images: if (imagesIds.length === 0) { EAction.handleUserWarning("No images found"); return; } // Minimal size threshold: var minSize = RS.PointTolerance; // Find first image sized below threshold: for (var i = 0; i < imagesIds.length; i++) { // Cycle all images var imagesId = imagesIds[i]; var image = doc.queryEntity(imagesId); // verify sizing, select uniquely and halt if required: if (image.getHeight() < minSize || image.getWidth() < minSize) { di.selectEntity(imagesId, false) // NOTadding return; } } // Loop images // Report no images matching: EAction.handleUserInfo("No minimal sized images found"); return;