Quantcast
Channel: Adobe Community: Message List
Viewing all articles
Browse latest Browse all 92756

Re: Switch Layers Script Question

$
0
0

nevermind, I got it! WOOHOO! It works now   Thanks for your guys help.. and just want you to know that I'm not looking for handouts... I'm genuinely trying to learn this type of code and after a few hours of experimenting/researching, I finally figured it out. Here it is:

 

var aDoc = app.activeDocument; 
var AllDocs = app.documents; 
var actLay = aDoc.activeLayer; 
var IndexCurrent = app.index 
if (AllDocs.length > 1) { 
var itemDoc = null;  
var win = new Window("dialog","Switch


Documents"); 
this.windowRef = win; 
win.Txt1 = win.add ("statictext", undefined,


"Switch to which document?"); 
win.NewList=win.add ("dropdownlist",


undefined) 
for (var m = 0; m < AllDocs.length; m++) { 
win.NewList.add("item", AllDocs[m].name)

if (AllDocs[m] == app.activeDocument)


{win.NewList.selection = m};
} 


itemDoc = win.NewList.selection.index;  
win.cancelBtn = win.add("button", undefined,


"Switch"); 


win.cancelElement = win.cancelBtn;  
win.NewList.onChange= function () {     itemDoc = win.NewList.selection.index;     return itemDoc;     }  
win.show();  
app.activeDocument = app.documents[itemDoc]; 

app.refresh(); 
} 

Viewing all articles
Browse latest Browse all 92756

Trending Articles