Skip to main content
Lumenn
Inspiring
December 15, 2019
Question

Getting groupItem from file without opening it.

  • December 15, 2019
  • 1 reply
  • 697 views

Hey i'm wondering if there is any way to load groupItem from .ai /.pdf file without opening it into Illustrator.

 

For example i know i can use:

app.preferences.PDFFileOptions.pageToOpen = 1;
groupItems.createFromFile(new File(pathToTheFile));

 This will place 1st page of .pdf file as a group in my Document, but all the names, tags etc. inside this group will be destroyed, even text frames will be sliced.
I think the same will happen with:

app.activeDocument.placedItems.add(new File(pathToFile));

 

So is there any other way to get data from the .ai / .pdf file without running this?

app.open(new File(pathToFile));

 

I'm working on illustrator with lots of plugins and opening a file may last ~15-120 seconds, so i'm looking for some way to avoid it.

This topic has been closed for replies.

1 reply

CarlosCanto
Community Expert
Community Expert
December 16, 2019

no, not that I'm aware of. 

Lumenn
LumennAuthor
Inspiring
December 17, 2019

Thanks at least i know, that i have to live with what i have 🙂
Seems like i'll have to simplify it as much as i can, so those placed files will be still good to process, or i can stick to my previous idea with keeping the document open. 


Inventsable
Legend
December 21, 2019

You make CEP panels, right? If you're trying to process multiple files you could have a CEP panel send an evalScript call to open some file, then using the documentAfterActivate event trigger your script on launch and have the document close itself afterward if needed, looping through a list of files for all of the above