Skip to main content
Inspiring
April 16, 2014
Answered

select document by name

  • April 16, 2014
  • 1 reply
  • 530 views

Hello everyone, could someone give me an example of how to select among several documents open a specific document by name and activate it

 

In JavaScript Object Reference could not find an example and as I am beginner it is difficult to assimilate without a practical example

 

I thank

This topic has been closed for replies.
Correct answer CarlosCanto

here's an example, you're probably missing the file extension

var docname = 'yourDocumentName.ai';

var idoc = app.documents.getByName (docname);

idoc.activate();

1 reply

CarlosCanto
Community Expert
CarlosCantoCommunity ExpertCorrect answer
Community Expert
April 16, 2014

here's an example, you're probably missing the file extension

var docname = 'yourDocumentName.ai';

var idoc = app.documents.getByName (docname);

idoc.activate();

Inspiring
April 16, 2014

Exactly, I forgot the extension

Very very thanks