Skip to main content
Inspiring
December 7, 2017
Answered

Script for place item in Illustrator?

  • December 7, 2017
  • 2 replies
  • 3120 views

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

    This topic has been closed for replies.
    Correct answer matthews63743827

    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");

    }

    2 replies

    matthews63743827AuthorCorrect answer
    Inspiring
    December 7, 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");

    }

    Ton Frederiks
    Community Expert
    Community Expert
    December 7, 2017

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