So I have a large number of *.ai files with assets at 3 unique sizes.

I want to export the right most one to file (the largest one).

My current process for doing this manually is:

  1. Open File
  2. Delete paths in left two artboards with V (Selection Tool) + (manually select paths) + Del.
  3. Enter artboard editor mode: Document Setup > Edit Artboards.
  4. Click 'X' icon in top right of each of the leftmost artboards to delete them.
  5. File > Export
  6. Click Use Artboards checkbox
  7. Click save (default name based upon *.ai file name is appropriate in my case).

enter image description here

Obviously if I had some way to batch or script this manual process, it would be much quicker.

A brief search in local questions yielded an answer on creating artboards via script, but nothing on going in the opposite direction -- deleting them via script.

Also: I should add that the leftmost two artboards (which I'm deleting) are always the same size and position relative the largest artboard. I imagine that would help on any automated solution, albeit I'm anticipating it'd be complex given the lack of pertinent material I found when poking around.

I guess you are doing steps you don't need to do.

  • Make an action saving a PDF copy and selecting just the art board 3

artboard3

Action

  • At the PDF options window, select Illustrator default

Illustrator Default

  • Uncheck Preserve Illustrator Editing Capabilities

Preserve Illustrator Editing Capabilities

  • Opening this PDF in Illustrator will only have the art board 3

Art board 3

After having all the PDFs it will be easier to make an action to save them as PNG from Illustrator or better a Photoshop batch.

  • 1
    I think the other answer may save me a bit more time, but I also appreciate your contribution as it gives me more options to skin the cat... err no pun intended. – Jason R. Mick Jun 13 at 12:46

You can make use of Illustrator Actions, but a little script inserted into your actions via menu item would help make the artboards part work.

#target illustrator
 function test(){
   var doc = app.activeDocument;
   doc.artboards[2].remove();
   doc.artboards[1].remove();
};
test();

Try this script to see if it removes the right artboards. If they are in a specific order, it will work. Otherwise put numbers 0 & 1 into the square brackets and see if that works!

  • I edited it to a proper code block, if that wasn't what you wanted, please feel free to roll it back. – WELZ Jun 13 at 2:21
  • After testing it, I see that removes the art boards but not its content, the second point in the question. – Danielillo Jun 13 at 6:18
  • 1
    For removing the other contents you can try to start with your main item selected, then use "select inverse" and "delete" inside of your action. – Silly-V Jun 13 at 6:24
  • 1
    Right, one upside to this approach is that you could potentially with a single selection do: - Art board remove (using script in answer) - Path delete (using Silly-V) - Export w/ artboard considered to PNG ...all in a single composited action. Compared to the PDF route, seems that would be a quicker route to getting the select artboard contents exported to the form I want (PNG). – Jason R. Mick Jun 13 at 12:45

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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