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

Getting groupItem from file without opening it.

Contributor ,
Dec 15, 2019 Dec 15, 2019

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.

TOPICS
Scripting , SDK
739
Translate
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 ,
Dec 15, 2019 Dec 15, 2019

no, not that I'm aware of. 

Translate
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
Contributor ,
Dec 16, 2019 Dec 16, 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. 


Translate
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
Enthusiast ,
Dec 20, 2019 Dec 20, 2019
LATEST

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

Translate
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