• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Automate Trim with Scripting

Engaged ,
Nov 25, 2017 Nov 25, 2017

Copy link to clipboard

Copied

This should be a fairly simple script, but I have decided to ask here because of my lack of experience.  The goal is to do a batch conversion of several thousand .eps files produced in an external application to .ai files, each of which are cropped in to remove all extra artboard space which is unused.  So essentially, I need it to do the following:

  1. Prompt the user to select multiple .eps files.
  2. Open the first .eps file.
  3. Remove the extra space by cropping (the same effect as going to Object -> Artwork -> Fit to Artwork Bounds)
  4. Save the current, modified document as an Illustrator file with the same name as the original file (but obviously the .ai extension instead of .eps).
  5. Close the current document without making changes to the original .eps file.
  6. Repeat steps 2 through 6 for the remainder of the files that were selected.

Unfortunately, I have no idea how I could write a script to accomplish this.  Any examples would be greatly, greatly appreciated.  At the very least, help guide me in the right direction here.  Thank you so much.

Views

796

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Community Expert ,
Nov 26, 2017 Nov 26, 2017

Copy link to clipboard

Copied

First thing that comes to mind is that there is a dedicated Scripting forum: Illustrator Scripting

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 26, 2017 Nov 26, 2017

Copy link to clipboard

Copied

Should not be too difficult to do with an Action.

Open an EPS file.

Create an Action that inserts 2 menu items;

Select > Select All

Object > Artboards > Fit to Selected Art

Save as

Now you can use Batch ... from the Actions menu to select a folder and apply the Action to the contents.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 26, 2017 Nov 26, 2017

Copy link to clipboard

Copied

LATEST

Action.png

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines