Everything works on Wondows 7 in CC and CS6.
In MAC OS, nothing works.
Does anyone have any idea why?
Code: Select all
{
function myScript(thisObj){
function myScript_buildUI(thisObj){
var myPanel = (thisObj instanceof Panel) ? thisObj : new Window("palette", "Layer Separation v01", undefined, {resizeable:true});
// Definition of Buttons and Textfields
res = "group{orientation:'row',\
grp1: Group{orientation:'column', text:'',\
grp2: Group{orientation:'row', text:'',\
Button01: Button{text:'CAM',preferredSize:[30,20]},\
Button02: Button{text:'CC',preferredSize:[25,20]},\
Button03: Button{text:'LIGHTS',preferredSize:[50,20]},\
Label: StaticText{text:'custom label:',preferredSize:[65,20]},\
Textfield: EditText{text:'Type in here'},\
Button04: Button{text:'Take it!',preferredSize:[50,20]},\
},\
},\
}";
myPanel.grp = myPanel.add(res);
// delete default text in EditText "CustomText"
myPanel.grp.grp1.grp2.Textfield.onActivate = function(){
myPanel.grp.grp1.grp2.Textfield.text ="";
}
// Button event
myPanel.grp.grp1.grp2.Button01.onClick = function(){
onTabClicked(myPanel.grp.grp1.grp2.Button01.text);
}
myPanel.grp.grp1.grp2.Button02.onClick = function(){
onTabClicked(myPanel.grp.grp1.grp2.Button02.text);
}
myPanel.grp.grp1.grp2.Button03.onClick = function(){
onTabClicked(myPanel.grp.grp1.grp2.Button03.text);
}
myPanel.grp.grp1.grp2.Button04.onClick = function(){
onTabClicked(myPanel.grp.grp1.grp2.Textfield.text);
}
// create null layer and add specific name
function onTabClicked(standard) {
myComp = app.project.item(1);
neuNull = myComp.layers.addNull();
neuNull.name = "____________________________ " + standard.toUpperCase();
// alert(this.text + " button clicked");
}
myPanel.layout.layout(true);
return myPanel;
}
var myScriptPal = myScript_buildUI(thisObj);
if (myScriptPal != null && myScriptPal instanceof Window){
myScriptPal.center();
myScriptPal.show();
}
}
myScript(this);
}