Solution: I had to just ask from Chat GPT for a script. Group is considered a separate object, while sublayer is not. // Prompt for the percentage value
var percentageStr = prompt("Enter the percentage value for scaling each object:", "50"); // Modify the default value as needed
var percentage = parseFloat(percentageStr) / 100;
// Function to transform the selected item
function transformItem(item) {
var bounds = item.visibleBounds;
var centerX = (bounds[2] + bounds[0]) / 2;
var centerY = (bounds[3] + bounds[1]) / 2;
item.translate(centerX, centerY);
item.resize(percentage * 100, percentage * 100, true, true, true, true, percentage * 100, Transformation.CENTER);
item.translate(-centerX, -centerY);
}
// Get the selected items
var selectedItems = app.activeDocument.selection;
// Apply transformation to each selected item
for (var i = 0; i < selectedItems.length; i++) {
var selectedItem = selectedItems[i];
transformItem(selectedItem);
}
... View more