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

Script for place item in Illustrator?

Community Beginner ,
Dec 07, 2017 Dec 07, 2017

Copy link to clipboard

Copied

I am trying to write a script for Illustrator that takes an image from a specific location on my computer and place it on my artboard.  This script should be pretty simple, but I can't seem to find an example of it anywhere?

Can anyone help?

Thanks!

Mat

Views

1.9K

Likes

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

correct answers 1 Correct answer

Community Beginner , Dec 07, 2017 Dec 07, 2017

I found the answer to this:

if ( app.documents.length > 0) {

    doc = app.activeDocument;

var placedItem = doc.placedItems.add();

placedItem.file = new File("image.jpg");

}

Likes

Translate

Translate
Community Expert ,
Dec 07, 2017 Dec 07, 2017

Copy link to clipboard

Copied

If the image has always the same name, you could record an Action.

Likes

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 Beginner ,
Dec 07, 2017 Dec 07, 2017

Copy link to clipboard

Copied

LATEST

I found the answer to this:

if ( app.documents.length > 0) {

    doc = app.activeDocument;

var placedItem = doc.placedItems.add();

placedItem.file = new File("image.jpg");

}

Likes

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