Writing the behavior of the UI window to change the active document
Hi everyone....
There are two checkboxes in the UI window. The first one is responsible for activating the document called "Source_l.ai", the second one is responsible for activating the document called "Dest_l.ai". In addition, when you change the active document, the active layer of the document should change. For this I write the following code
----------------------------------------------------------------------
ch_Sourse.onClick = function(){
ch_Dest.value = false;
app.documents.getByName("Source_l.ai").activate();
app.activeDocument.activeLayer = app.activeDocument.layers[0];
app.redraw();
}
ch_Dest.onClick = function(){
ch_Sourse.value = false;
app.documents.getByName("Dest_l.ai").activate();
app.activeDocument.activeLayer = app.activeDocument.layers[1];
app.redraw();
}
------------------------------------------------------------------------
But with this implementation, the active document does not change, and the active layer of this document does not change. Maybe someone faced such a problem? Thanks in advance.
