I need to import symbols from an Ai file to other documents by script, then place them by replacing objects.
I have no problem with the replacement of a symbol when it's part of the symbols of the document.
What I fail to do, it's the importation of a symbol collection from an Ai file to the current document.
I load the symbol document as a symbol library, in this way:
var openOptions = new OpenOptions(); openOptions.openAs = LibraryType.SYMBOLS; var symbolDocument = app.open(File('/d/test/symbol_collection.ai'), null, openOptions);
It works well as it opens a symbol collection window in Illustrator.
But I don't know how to get these symbols to copy them into the current document.
When I invoke symbolDocument.symbols, I get a 'The document is no longer open' error.
So, how to copy symbols? How to access this symbol collection loaded in Illustrator other than using the symbolDocument?
Thanks a lot.