How do I call Window → Pathfinder → Divide through JavaScript in Illustrator? If not, can I call an action that pushes this button through javascript?


Use this code to apply Divide Effect. Please note that the effect must be applied to groups.

to group selected items, use


to apply the Divide effect to a selected group, use

app.executeMenuCommand('Live Pathfinder Divide');

if you need to expand appearance, use

  • This works but its not entirely ideal because it intercepts the style. You would need to take any exsting style and take it out and return it back. So this is not pathfinder divide as such and has other nasty side effects and is harder to use. – joojaa Jan 5 '17 at 9:10
  • Oh by the way if you include how you need to group the date first and apply the divide effect on the group then ill up vote you. – joojaa Jan 5 '17 at 9:39
  • sorry, I didn't post a complete working sample, merely showing that there was an alternative access to the much needed Path Finder tools. – Carlos Canto Jan 6 '17 at 6:52
  • Yes, though my reading of the OP is that they are aware of this since they explicitly say pathfinder. – joojaa Jan 6 '17 at 8:21

Elmentary you can not. Tough you can kludge your way trough the system and call a action that has been recorded to use pathfinder. The scripting interface of Illustrator is pretty limited in scope.

The extendscript that comes with Adobe apps can not call the windowing subsystem to press buttons. NodeJS could be made to do that tough but then that wouldnt be a simple script.

  • trying not to hijack the thread, how do we use NodeJS in Illustrator? – Carlos Canto Jan 5 '17 at 8:49
  • @CarlosCanto you do not! You can use windows COM though or OSA on OSX. But that is a different API and not compatible acros operating systems – joojaa Jan 5 '17 at 9:07
  • @CarlosCanto if you want more info feel free to drop by into the chat – joojaa Jan 5 '17 at 9:31
  • thanks for the info, the link and the offer to chat. I will definitely pay you a visit there...not now though, I'm in a crunch at the moment. – Carlos Canto Jan 6 '17 at 6:46

Yea, you can have a previously recorded (or dynamically written too) action that does the pathfinder operation and then it's as simple as doing app.doScript(actionName, setName)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.