Legend
September 15, 2026
Question
Weird! Why is the content adaptation framework code ineffective for it?
- September 15, 2026
- 9 replies
- 40 views
Please use the direct selection tool to select the innermost image.
The code is invalid for the blue image in the middle. Effective on the right side.
The reason for this may be that I held down "Ctrl+Shift+left mouse button" and dragged the innermost "image".
var d = app.activeDocument;
var item = d.selection[0];
//alert(item.constructor.name);
//alert(item.parent.parent.constructor.name);
// direct selection tool
if (item.constructor.name == "Image") {
//alert('000')
contentFitToFrame(item.parent.parent)
}
function contentFitToFrame(s) {
//alert('001')
s.frameFittingOptions.fittingAlignment = AnchorPoint.TOP_LEFT_ANCHOR;
s.fit(FitOptions.FILL_PROPORTIONALLY);
}
