Grouped object - ungroup - Pathfinder Add - Convert to Rectangle
Playing with scripting and finding it very frustrating but this one would save me a good bit of time
I just want to ungroup an object - leave it selected
I figured that out
var ungroupMenuItem = app.menuActions.item("$ID/Ungroup");
if (ungroupMenuItem.isValid) {
// Invoke the menu item
ungroupMenuItem.invoke();
} else {
alert("The Ungroup menu item was not found.");
}
Seems to work - maybe not the best way
But can't access
Object>Path>add
Then next step is
Object>Convert to Shape>Rectangle
All the while leaving the object selected while running through
1 out of 3 ain't bad...
Ultimately - I have 2 of these objects on every page that need to be ungrouped
Ideally I'd like to just make them a link - as I'm replacing them with an image anyway
If they were converted to links that would be ideal
So I would select the objects on the page in 1 selection - then run the script - it makes them a link
Then I can just relink them
But given that I can't convert the group to a rectangle by scripting I feel the former and latter part of my plan is beyond me.
Any help is much appreciated.

