I am creating an Illustrator action that automates shape cutting however now I need to put a system in the batch process where it stops and let the user draw the line or an area according to which the shape will be cut. So far, I am unsuccessful. Can anyone suggest?

enter image description here

Scripts are welcome. No problem in using them.

  • yeah you kind of make use of script for letting user input but i am still not sure that it might work exactly as you want! please add some images if possible!
    – Mr.Online
    Commented Jun 22, 2019 at 9:04
  • 2
    Split the action into 2. There is no mechanism for a script to monitor actions. So even in that case you need a button press to resume, same as splitting the action in 2.
    – joojaa
    Commented Jun 22, 2019 at 9:05
  • @DesignPhoenix : Example added. Commented Jun 22, 2019 at 9:26
  • @joojaa: Yeah, that can be an option however would be better if there are no breaks. Just a pause for the user to draw the line, hit resume and the batch will continue. Commented Jun 22, 2019 at 9:27
  • as @joojaa mentioned even scripting doesn't allow user to input and then continue. it's just that script might create workaround! have to look around :)
    – Mr.Online
    Commented Jun 22, 2019 at 10:37

1 Answer 1


Two line of code can automate cutting stuff

=> you can embed script into your action but you should know that action can be paused via stop command but script don't usually wait for such kind of stuff but for workaround you can load your stuffs via batch processing - your main which only loads your shapes

=> now save this code as run.jsx and put it in your illustrator folder C:\Program Files\Adobe\Adobe Illustrator CC 2019\Presets\en_US\Scripts and restart illustrator and then you can follow below image

app.executeMenuCommand('Knife Tool2');  

enter image description here

Image Explaination : Basically i had blank action named "Your main action" which in your case can be anything which just load any files or stuffs just keep in mind that you have nothing selected once action completes and then just create new action names "Cutting Action" and add Run.jsx in action and assign any shortcut "F2" in my case!

Now all you have to draw the line by pencil tool and press F2 and see magic happen! it can cut the one object in hundreds of parts!!

  • @joojaa i still worried that is it really possible in extendscript or js DOM that can script stop for any input. ( like getting state changes or something )
    – Mr.Online
    Commented Jun 22, 2019 at 12:20
  • 1
    You can open a window that has a button that executes the rest of the script. But this does not differ from having 2 separate actions executed one after another. Theres nothing that forces the user to continue tge script. Illustrator has no DOM only webpages do
    – joojaa
    Commented Jun 22, 2019 at 13:03
  • well then he should go with Stop command in action since stop command can give alert too or can be silent too! but it's all same though!
    – Mr.Online
    Commented Jun 24, 2019 at 3:00
  • Hi, thanks for all the suggestions however, none of it works. I tried the code given by @DesignPhoenix and it does not let me know stop the action in the middle. The action itself is quite long and I have to insert the "Stop" or "Pause" for user input in the middle of it. The problem with "Stop" is that it shows an error every time saying "An error was encountered while batching". If I allow "Continue" it continues like nothing happened so does not help me putting an input. Probably I will have to go for two different actions. Commented Jun 24, 2019 at 6:23
  • as we already said since start you need to use two actions and for that you have to stop using Batch. in your case create a script with For LOOP to and then call action in the script by using app.doScript("Action","Set");
    – Mr.Online
    Commented Jun 24, 2019 at 6:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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