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

Need help with a short Illustrator Script

Community Beginner ,
Feb 23, 2017 Feb 23, 2017

Copy link to clipboard

Copied

Hello Illustrator Scripting Community,


I'm searching a long time for a solution with a short Illustrator Script. Maybe you can help me.

If you have any idea how to solve my problem via "actions" I would also bei very happy.


The following I need to do.

1. Open several Files each by each in Adobe Illustrator (this is also possible with actions)

2. Select all graphics inside of the file (this is also possible with actions)

3. via the Panel "Links" I need to use the function "embed picture(s)" (this is not working to record this part for an action)


My question ist now. Is there any other way to get "embed picture(s)" into any action recorded or do I need to have a Illustrator Scrip which solves the hole three steps for me? If so, is anybody able to write this script, because I have no idea of scripting in Illustrator.


Thank you very much for your help

best regards

Daniel

TOPICS
Scripting

Views

1.5K

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

Engaged , Feb 24, 2017 Feb 24, 2017

Votes

Translate

Translate
Adobe
Engaged ,
Feb 23, 2017 Feb 23, 2017

Copy link to clipboard

Copied

Hi, info@danielberkmann.com​!

How many files you want to open at one launch of the script?

New  File after opening and taking actions immediately close, right? And open the next.

NewNew What to do with the file after make changes? Save in the same folder or save to another folder so the original is left unchanged? Or...?

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 Beginner ,
Feb 23, 2017 Feb 23, 2017

Copy link to clipboard

Copied

Hey o-marat

thank you very much for your answer. The best case for me would be saving it in the same folder to overwrite the old file. And yes then open the next one, the next one, and so on.

At the moment I have 170 files who I like to run the script with, but there are coming more.

One at a time would be great, otherwise my Illustrator crashes, because some of the files are very complex.

Maybe with the script it is possible to select a folder and the script opens every file (one at a time) in this folder, embeds all Links, saves (overwrites) it and closes it.

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
Engaged ,
Feb 24, 2017 Feb 24, 2017

Copy link to clipboard

Copied

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 Beginner ,
Feb 25, 2017 Feb 25, 2017

Copy link to clipboard

Copied

WOW, that's a very crazy complex script. I just testet it with a view files and it works. I'm totally thrilled! Thank your very very much!

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 Beginner ,
Feb 25, 2017 Feb 25, 2017

Copy link to clipboard

Copied

Hey o-marat,

first of all again thank you very much. The script is totally awesome and nearly solves my problem perfectly. While running the script I had now multiple times the same error message at some files:

"

line 169

an Illustrator error occurred: 1346458189 ('MRAP')

"

line 169 in your script says " raster.embed();"

I think I know where the problem is. Sometimes if the linked pictures are not selected the function "embed picture(s)" is not available to use in Illustrator. I think the solution to that would be to integrate one step before embedding the pictures that says "select all".

I would change the script on my own, but I don't know how to integrate this function.

Thanks a lot!

Daniel

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
Engaged ,
Feb 25, 2017 Feb 25, 2017

Copy link to clipboard

Copied

Hi, Daniel!

The script doesn't select something directly.

And it should work even if all the objects are locked and/or hidden.

The error occurs always on random files or on some specific files?

Could you give me your files at which error occurs?

And what you Illustrator and OS version?

Thanks!

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 Beginner ,
Feb 25, 2017 Feb 25, 2017

Copy link to clipboard

Copied

Hey o-marat,

yes the error occurs on random files.

I tried to open those files and changed something like if the layer is locked or which layer is selected, when I close the file.

Now that I changed those things at the "error files" everything is working with your script. These days I create some new files and I think then I get the error message again. If the error occurs with one of the new files I'll send you those.

Thanks for your answer and your help.

Daniel

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
Guide ,
Mar 01, 2017 Mar 01, 2017

Copy link to clipboard

Copied

mrap error.

thats mac yes.

the docs say you should be good to process 500 files before restarting illustrator.

but i have found it gets buggy well before the limits listed inthe docs.

i would try doing them in a few batches.

an illustrator restart and script continuation could be added. but this would be too complex for here.

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 Beginner ,
Mar 01, 2017 Mar 01, 2017

Copy link to clipboard

Copied

Hey,

thank you for the information. That's very helpful. I hope I don't need to process over 500 files .

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
Guide ,
Mar 01, 2017 Mar 01, 2017

Copy link to clipboard

Copied

the mrap errors are common when processing many files.

is it always the same line?

it could be illy needs some time to catchup.

$.sleep (1000);

this befor the raster.embed line may be enough.

or the offending line could be wrapped in a try/catch with a loop to try a few times befor tossing an error.

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
New Here ,
Jul 25, 2018 Jul 25, 2018

Copy link to clipboard

Copied

LATEST

Hello o-marat - I used the script that you provided and it works perfectly for what I am trying to do. However, is there any way to add an option to select all text and create outlines of all the text in the illustrator document? I am mass outputting files to provide to a vendor (I do this many times a day with multiple files) and the text needs to always be outlined. Please let me know if you can help! Thanks! Alicia 

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
Engaged ,
Feb 23, 2017 Feb 23, 2017

Copy link to clipboard

Copied

This is the simple function to embedded all palced items in the active document:

embedRasters();

function embedRasters() {

  var d          = activeDocument;

  var rasters    = d.placedItems;

  var rastersLen = rasters.length;

  for (var i = rastersLen - 1; i >= 0; i--) {

    var raster = rasters;

    raster.embed();

  }

}

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