Skip to main content
Inspiring
May 15, 2012
Answered

activate an existing document

  • May 15, 2012
  • 1 reply
  • 1308 views

Hi,

For example: I have opened 10 documents at a time. But I have to get active one of an existing document.

How do i get activate a particular existing document by name through Photoshop scripting?

so could you please help me on this...

thanks in advance,

Rajiv.s

This topic has been closed for replies.
Correct answer Muppet Mark

app.activeDocument = app.documents.getByName( 'Foo' );

1 reply

Muppet MarkCorrect answer
Inspiring
May 15, 2012

app.activeDocument = app.documents.getByName( 'Foo' );

Inspiring
August 24, 2012

How do i get select documents by index?

Pedro Cortez Marques
Legend
August 24, 2012

alert(getActiveDocumentIndex())  // it  gives the index number

function getActiveDocumentIndex(){

     var ref = new ActionReference();

     ref.putEnumerated( charIDToTypeID("Dcmn"), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );

     return desc = executeActionGet(ref).getInteger(stringIDToTypeID('itemIndex'))-1;

}