Copy link to clipboard
Copied
How can one by script "Create a Compound Shape and intersect shape area" ?
I couldn't find the menu command?
We've got to use actions or menu commands.
The pathfinder operations are recordable, but you can also use the menu commands on paths which you have to first ensure are in a group. Then apply a pathfinder EFFECT from the menu commands and follow up with "Expand Style" menu command to destructively fix the changes in place.
Thanks to Ten A​ and his new intuitively-compiled catalogue of execute menu command strings, this block is our dictionary for pathfinder commands to be used with the app.executeM
...Copy link to clipboard
Copied
The only thing that I know:
app.executeMenuCommand ("compoundPath"); // opposite: app.executeMenuCommand ("noCompoundPath");
It's the same as
menu: Object --> Compound Path --> Make
Copy link to clipboard
Copied
We've got to use actions or menu commands.
The pathfinder operations are recordable, but you can also use the menu commands on paths which you have to first ensure are in a group. Then apply a pathfinder EFFECT from the menu commands and follow up with "Expand Style" menu command to destructively fix the changes in place.
Thanks to Ten A​ and his new intuitively-compiled catalogue of execute menu command strings, this block is our dictionary for pathfinder commands to be used with the app.executeMenuCommand() function.
Beware though, as I have discovered some inconsistencies with expectation/reality when it comes to using the menu commands as alternatives to comparable scripting methods or actions. They are not easy to describe, but once you come across a few examples you can generally get the idea.
For example, having a placed item selected and going "Edit Original" can open the file but waits to do so after the script has been ran - while the app.open command does it in sync.
In the context of your usage though, I believe it has been proven to work just fine on these forums for years now.
This is [ANN] Adding AiMenu class.​ from Ten A​
"pathfinder" : { | |
"add" : "Live Pathfinder Add", | |
"intersect" : "Live Pathfinder Intersect", | |
"exclude" : "Live Pathfinder Exclude", | |
"subtract" : "Live Pathfinder Subtract", | |
"minusBack" : "Live Pathfinder Minus Back", | |
"divide" : "Live Pathfinder Divide", | |
"trim" : "Live Pathfinder Trim", | |
"merge" : "Live Pathfinder Merge", | |
"crop" : "Live Pathfinder Crop", | |
"outline" : "Live Pathfinder Outline", | |
"hardMix" : "Live Pathfinder Hard Mix", | |
"softMix" : "Live Pathfinder Soft Mix", | |
"trap" : "Live Pathfinder Trap" | |
}, |
Copy link to clipboard
Copied
Thanks guys
I couldn't find the menu item. I had looked both through Ten's aiMenu and the SDKs executeMenuCommands string list and couldn't find the command for "Create a Compound Shape and intersect shape area" I look particularly at the the pathfinder items and couldn't find compound shape ones other than the make and release which didn't help.
The action recording works well and I can't think why I didn't think of it.
The app.executeMenuCommand() problems link is very interesting. I am finding that it fails in the color convert about 1 in 20 times.
Copy link to clipboard
Copied
I'm just putting this link hear as a reminder to myself where to find the AIMenuCommandString.h file in the SDK, It's under File list > AIMenuCommandString.h
Here's a link to an online version (2015) updated one is in the SDK
Bloks/AIMenuCommandString.h at master · WestonThayer/Bloks · GitHub