How to make script to a dockable panel?
I made a simple script that adds keyframes to multiple layers with one click but it is not very comfortable to use as I have to open it from the scripts menu.
I want to make the script to a dockable panel. Can anyone help me out?
I started JavaScripting 2 days ago and this is my first script so I don't know much anything.
Sorry for long post. I don't know how to make a spoiler.
This is the original one:
var myWin = new Window("palette", "My Window", undefined);
myWin.orientation = "row";
var slct = app.project.activeItem;
////////////////////////////////////////////---face (eyes) drop-down menu---select layers
var groupOne = myWin.add("group", undefined, "GroupOne");
groupOne.orientation = "column";
groupOne.add("statictext", undefined, "Neutral face layer");
var ddNeutral = groupOne.add("dropdownlist", undefined, [slct.layer(1).name, slct.layer(2).name, slct.layer(3).name, slct.layer(4).name, slct.layer(5).name, slct.layer(6).name, slct.layer(7).name, slct.layer(8).name, slct.layer(9).name, slct.layer(10).name, slct.layer(11).name, slct.layer(12).name, slct.layer(13).name]);
groupOne.add("statictext", undefined, "Angry face layer");
var ddAngry = groupOne.add("dropdownlist", undefined, [slct.layer(1).name, slct.layer(2).name, slct.layer(3).name, slct.layer(4).name, slct.layer(5).name, slct.layer(6).name, slct.layer(7).name, slct.layer(8).name, slct.layer(9).name, slct.layer(10).name, slct.layer(11).name, slct.layer(12).name, slct.layer(13).name]);
groupOne.add("statictext", undefined, "Sad face layer");
var ddSad = groupOne.add("dropdownlist", undefined, [slct.layer(1).name, slct.layer(2).name, slct.layer(3).name, slct.layer(4).name, slct.layer(5).name, slct.layer(6).name, slct.layer(7).name, slct.layer(8).name, slct.layer(9).name, slct.layer(10).name, slct.layer(11).name, slct.layer(12).name, slct.layer(13).name]);
////////////////////////////////////////////---face (eyes) buttons
var groupTwo = myWin.add("group", undefined, "GroupTwo");
groupTwo.orientation = "column";
var bttnNeutral = groupTwo.add("button", undefined, "neutral face");
var bttnAngry = groupTwo.add("button", undefined, "angry face");
var bttnSad = groupTwo.add("button", undefined, "sad face");
///////////////////////////////////////////---mouth drop-down menu---select layers
var groupThree = myWin.add("group", undefined, "GroupThree");
groupThree.orientation = "column";
groupThree.add("statictext", undefined, "Happy mouth layer");
var ddHappyM = groupThree.add("dropdownlist", undefined, [slct.layer(1).name, slct.layer(2).name, slct.layer(3).name, slct.layer(4).name, slct.layer(5).name, slct.layer(6).name, slct.layer(7).name, slct.layer(8).name, slct.layer(9).name, slct.layer(10).name, slct.layer(11).name, slct.layer(12).name, slct.layer(13).name]);
groupThree.add("statictext", undefined, "Neutral mouth layer");
var ddNeutralM = groupThree.add("dropdownlist", undefined, [slct.layer(1).name, slct.layer(2).name, slct.layer(3).name, slct.layer(4).name, slct.layer(5).name, slct.layer(6).name, slct.layer(7).name, slct.layer(8).name, slct.layer(9).name, slct.layer(10).name, slct.layer(11).name, slct.layer(12).name, slct.layer(13).name]);
groupThree.add("statictext", undefined, "Sad mouth layer");
var ddSadM = groupThree.add("dropdownlist", undefined, [slct.layer(1).name, slct.layer(2).name, slct.layer(3).name, slct.layer(4).name, slct.layer(5).name, slct.layer(6).name, slct.layer(7).name, slct.layer(8).name, slct.layer(9).name, slct.layer(10).name, slct.layer(11).name, slct.layer(12).name, slct.layer(13).name]);
groupThree.add("statictext", undefined, "Angry mouth layer");
var ddAngryM = groupThree.add("dropdownlist", undefined, [slct.layer(1).name, slct.layer(2).name, slct.layer(3).name, slct.layer(4).name, slct.layer(5).name, slct.layer(6).name, slct.layer(7).name, slct.layer(8).name, slct.layer(9).name, slct.layer(10).name, slct.layer(11).name, slct.layer(12).name, slct.layer(13).name]);
groupThree.add("statictext", undefined, "Smiley mouth layer");
var ddSmileyM = groupThree.add("dropdownlist", undefined, [slct.layer(1).name, slct.layer(2).name, slct.layer(3).name, slct.layer(4).name, slct.layer(5).name, slct.layer(6).name, slct.layer(7).name, slct.layer(8).name, slct.layer(9).name, slct.layer(10).name, slct.layer(11).name, slct.layer(12).name, slct.layer(13).name]);
groupThree.add("statictext", undefined, "Surprised mouth layer");
var ddSurprisedM = groupThree.add("dropdownlist", undefined, [slct.layer(1).name, slct.layer(2).name, slct.layer(3).name, slct.layer(4).name, slct.layer(5).name, slct.layer(6).name, slct.layer(7).name, slct.layer(8).name, slct.layer(9).name, slct.layer(10).name, slct.layer(11).name, slct.layer(12).name, slct.layer(13).name]);
////////////////////////////////////////////---mouth buttons
var groupFour = myWin.add("group", undefined, "GroupFour");
groupFour.orientation = "column";
var bttnHappyM = groupFour.add("button", undefined, "happy mouth");
var bttnNeutralM = groupFour.add("button", undefined, "neutral mouth");
var bttnSadM = groupFour.add("button", undefined, "sad mouth");
var bttnAngryM = groupFour.add("button", undefined, "angry mouth");
var bttnSmileyM = groupFour.add("button", undefined, "smiley mouth");
var bttnSurprisedM = groupFour.add("button", undefined, "surprised mouth");
myWin.center();
myWin.show();
alert("Select layers before clicking OK"); //remove later
var neutral = slct.layer(ddNeutral.selection.index + 1);
var angry = slct.layer(ddAngry.selection.index + 1);
var sad = slct.layer(ddSad.selection.index + 1);
var happyM = slct.layer(ddHappyM.selection.index + 1);
var neutralM = slct.layer(ddNeutralM.selection.index + 1);
var sadM = slct.layer(ddSadM.selection.index + 1);
var angryM = slct.layer(ddAngryM.selection.index + 1);
var smileyM = slct.layer(ddSmileyM.selection.index + 1);
var surprisedM = slct.layer(ddSurprisedM.selection.index + 1);
bttnNeutral.onClick = function () {
var curTime = app.project.activeItem.time;
neutral.property("ADBE Transform Group").property("Opacity").setValueAtTime(curTime,100);
var keyIndex = neutral.property("ADBE Transform Group").property("Opacity").nearestKeyIndex(curTime);
neutral.property("ADBE Transform Group").property("Opacity").setInterpolationTypeAtKey(keyIndex, KeyframeInterpolationType.HOLD, KeyframeInterpolationType.HOLD);
angry.property("ADBE Transform Group").property("Opacity").setValueAtTime(curTime,0);
var keyIndex = angry.property("ADBE Transform Group").property("Opacity").nearestKeyIndex(curTime);
angry.property("ADBE Transform Group").property("Opacity").setInterpolationTypeAtKey(keyIndex, KeyframeInterpolationType.HOLD, KeyframeInterpolationType.HOLD);
sad.property("ADBE Transform Group").property("Opacity").setValueAtTime(curTime,0);
var keyIndex = sad.property("ADBE Transform Group").property("Opacity").nearestKeyIndex(curTime);
sad.property("ADBE Transform Group").property("Opacity").setInterpolationTypeAtKey(keyIndex, KeyframeInterpolationType.HOLD, KeyframeInterpolationType.HOLD);
}
bttnAngry.onClick = function () {
var curTime = app.project.activeItem.time;
neutral.property("ADBE Transform Group").property("Opacity").setValueAtTime(curTime,0);
var keyIndex = neutral.property("ADBE Transform Group").property("Opacity").nearestKeyIndex(curTime);
neutral.property("ADBE Transform Group").property("Opacity").setInterpolationTypeAtKey(keyIndex, KeyframeInterpolationType.HOLD, KeyframeInterpolationType.HOLD);
angry.property("ADBE Transform Group").property("Opacity").setValueAtTime(curTime,100);
var keyIndex = angry.property("ADBE Transform Group").property("Opacity").nearestKeyIndex(curTime);
angry.property("ADBE Transform Group").property("Opacity").setInterpolationTypeAtKey(keyIndex, KeyframeInterpolationType.HOLD, KeyframeInterpolationType.HOLD);
sad.property("ADBE Transform Group").property("Opacity").setValueAtTime(curTime,0);
var keyIndex = sad.property("ADBE Transform Group").property("Opacity").nearestKeyIndex(curTime);
sad.property("ADBE Transform Group").property("Opacity").setInterpolationTypeAtKey(keyIndex, KeyframeInterpolationType.HOLD, KeyframeInterpolationType.HOLD);
}
bttnSad.onClick = function () {
var curTime = app.project.activeItem.time;
neutral.property("ADBE Transform Group").property("Opacity").setValueAtTime(curTime,0);
var keyIndex = neutral.property("ADBE Transform Group").property("Opacity").nearestKeyIndex(curTime);
neutral.property("ADBE Transform Group").property("Opacity").setInterpolationTypeAtKey(keyIndex, KeyframeInterpolationType.HOLD, KeyframeInterpolationType.HOLD);
angry.property("ADBE Transform Group").property("Opacity").setValueAtTime(curTime,0);
var keyIndex = angry.property("ADBE Transform Group").property("Opacity").nearestKeyIndex(curTime);
angry.property("ADBE Transform Group").property("Opacity").setInterpolationTypeAtKey(keyIndex, KeyframeInterpolationType.HOLD, KeyframeInterpolationType.HOLD);
sad.property("ADBE Transform Group").property("Opacity").setValueAtTime(curTime,100);
var keyIndex = sad.property("ADBE Transform Group").property("Opacity").nearestKeyIndex(curTime);
sad.property("ADBE Transform Group").property("Opacity").setInterpolationTypeAtKey(keyIndex, KeyframeInterpolationType.HOLD, KeyframeInterpolationType.HOLD);
}
bttnHappyM.onClick = function () {
var curTime = app.project.activeItem.time;
happyM.property("ADBE Transform Group").property("Opacity").setValueAtTime(curTime,100);
var keyIndex = happyM.property("ADBE Transform Group").property("Opacity").nearestKeyIndex(curTime);
happyM.property("ADBE Transform Group").property("Opacity").setInterpolationTypeAtKey(keyIndex, KeyframeInterpolationType.HOLD, KeyframeInterpolationType.HOLD);
neutralM.property("ADBE Transform Group").property("Opacity").setValueAtTime(curTime,0);
var keyIndex = neutralM.property("ADBE Transform Group").property("Opacity").nearestKeyIndex(curTime);
neutralM.property("ADBE Transform Group").property("Opacity").setInterpolationTypeAtKey(keyIndex, KeyframeInterpolationType.HOLD, KeyframeInterpolationType.HOLD);
sadM.property("ADBE Transform Group").property("Opacity").setValueAtTime(curTime,0);
var keyIndex = sadM.property("ADBE Transform Group").property("Opacity").nearestKeyIndex(curTime);
sadM.property("ADBE Transform Group").property("Opacity").setInterpolationTypeAtKey(keyIndex, KeyframeInterpolationType.HOLD, KeyframeInterpolationType.HOLD);
angryM.property("ADBE Transform Group").property("Opacity").setValueAtTime(curTime,0);
var keyIndex = angryM.property("ADBE Transform Group").property("Opacity").nearestKeyIndex(curTime);
angryM.property("ADBE Transform Group").property("Opacity").setInterpolationTypeAtKey(keyIndex, KeyframeInterpolationType.HOLD, KeyframeInterpolationType.HOLD);
smileyM.property("ADBE Transform Group").property("Opacity").setValueAtTime(curTime,0);
var keyIndex = smileyM.property("ADBE Transform Group").property("Opacity").nearestKeyIndex(curTime);
smileyM.property("ADBE Transform Group").property("Opacity").setInterpolationTypeAtKey(keyIndex, KeyframeInterpolationType.HOLD, KeyframeInterpolationType.HOLD);
surprisedM.property("ADBE Transform Group").property("Opacity").setValueAtTime(curTime,0);
var keyIndex = surprisedM.property("ADBE Transform Group").property("Opacity").nearestKeyIndex(curTime);
surprisedM.property("ADBE Transform Group").property("Opacity").setInterpolationTypeAtKey(keyIndex, KeyframeInterpolationType.HOLD, KeyframeInterpolationType.HOLD);
}
bttnNeutralM.onClick = function () {
var curTime = app.project.activeItem.time;
happyM.property("ADBE Transform Group").property("Opacity").setValueAtTime(curTime,0);
var keyIndex = happyM.property("ADBE Transform Group").property("Opacity").nearestKeyIndex(curTime);
happyM.property("ADBE Transform Group").property("Opacity").setInterpolationTypeAtKey(keyIndex, KeyframeInterpolationType.HOLD, KeyframeInterpolationType.HOLD);
neutralM.property("ADBE Transform Group").property("Opacity").setValueAtTime(curTime,100);
var keyIndex = neutralM.property("ADBE Transform Group").property("Opacity").nearestKeyIndex(curTime);
neutralM.property("ADBE Transform Group").property("Opacity").setInterpolationTypeAtKey(keyIndex, KeyframeInterpolationType.HOLD, KeyframeInterpolationType.HOLD);
sadM.property("ADBE Transform Group").property("Opacity").setValueAtTime(curTime,0);
var keyIndex = sadM.property("ADBE Transform Group").property("Opacity").nearestKeyIndex(curTime);
sadM.property("ADBE Transform Group").property("Opacity").setInterpolationTypeAtKey(keyIndex, KeyframeInterpolationType.HOLD, KeyframeInterpolationType.HOLD);
angryM.property("ADBE Transform Group").property("Opacity").setValueAtTime(curTime,0);
var keyIndex = angryM.property("ADBE Transform Group").property("Opacity").nearestKeyIndex(curTime);
angryM.property("ADBE Transform Group").property("Opacity").setInterpolationTypeAtKey(keyIndex, KeyframeInterpolationType.HOLD, KeyframeInterpolationType.HOLD);
smileyM.property("ADBE Transform Group").property("Opacity").setValueAtTime(curTime,0);
var keyIndex = smileyM.property("ADBE Transform Group").property("Opacity").nearestKeyIndex(curTime);
smileyM.property("ADBE Transform Group").property("Opacity").setInterpolationTypeAtKey(keyIndex, KeyframeInterpolationType.HOLD, KeyframeInterpolationType.HOLD);
surprisedM.property("ADBE Transform Group").property("Opacity").setValueAtTime(curTime,0);
var keyIndex = surprisedM.property("ADBE Transform Group").property("Opacity").nearestKeyIndex(curTime);
surprisedM.property("ADBE Transform Group").property("Opacity").setInterpolationTypeAtKey(keyIndex, KeyframeInterpolationType.HOLD, KeyframeInterpolationType.HOLD);
}
bttnSadM.onClick = function () {
var curTime = app.project.activeItem.time;
happyM.property("ADBE Transform Group").property("Opacity").setValueAtTime(curTime,0);
var keyIndex = happyM.property("ADBE Transform Group").property("Opacity").nearestKeyIndex(curTime);
happyM.property("ADBE Transform Group").property("Opacity").setInterpolationTypeAtKey(keyIndex, KeyframeInterpolationType.HOLD, KeyframeInterpolationType.HOLD);
neutralM.property("ADBE Transform Group").property("Opacity").setValueAtTime(curTime,0);
var keyIndex = neutralM.property("ADBE Transform Group").property("Opacity").nearestKeyIndex(curTime);
neutralM.property("ADBE Transform Group").property("Opacity").setInterpolationTypeAtKey(keyIndex, KeyframeInterpolationType.HOLD, KeyframeInterpolationType.HOLD);
sadM.property("ADBE Transform Group").property("Opacity").setValueAtTime(curTime,100);
var keyIndex = sadM.property("ADBE Transform Group").property("Opacity").nearestKeyIndex(curTime);
sadM.property("ADBE Transform Group").property("Opacity").setInterpolationTypeAtKey(keyIndex, KeyframeInterpolationType.HOLD, KeyframeInterpolationType.HOLD);
angryM.property("ADBE Transform Group").property("Opacity").setValueAtTime(curTime,0);
var keyIndex = angryM.property("ADBE Transform Group").property("Opacity").nearestKeyIndex(curTime);
angryM.property("ADBE Transform Group").property("Opacity").setInterpolationTypeAtKey(keyIndex, KeyframeInterpolationType.HOLD, KeyframeInterpolationType.HOLD);
smileyM.property("ADBE Transform Group").property("Opacity").setValueAtTime(curTime,0);
var keyIndex = smileyM.property("ADBE Transform Group").property("Opacity").nearestKeyIndex(curTime);
smileyM.property("ADBE Transform Group").property("Opacity").setInterpolationTypeAtKey(keyIndex, KeyframeInterpolationType.HOLD, KeyframeInterpolationType.HOLD);
surprisedM.property("ADBE Transform Group").property("Opacity").setValueAtTime(curTime,0);
var keyIndex = surprisedM.property("ADBE Transform Group").property("Opacity").nearestKeyIndex(curTime);
surprisedM.property("ADBE Transform Group").property("Opacity").setInterpolationTypeAtKey(keyIndex, KeyframeInterpolationType.HOLD, KeyframeInterpolationType.HOLD);
}
bttnAngryM.onClick = function () {
var curTime = app.project.activeItem.time;
happyM.property("ADBE Transform Group").property("Opacity").setValueAtTime(curTime,0);
var keyIndex = happyM.property("ADBE Transform Group").property("Opacity").nearestKeyIndex(curTime);
happyM.property("ADBE Transform Group").property("Opacity").setInterpolationTypeAtKey(keyIndex, KeyframeInterpolationType.HOLD, KeyframeInterpolationType.HOLD);
neutralM.property("ADBE Transform Group").property("Opacity").setValueAtTime(curTime,0);
var keyIndex = neutralM.property("ADBE Transform Group").property("Opacity").nearestKeyIndex(curTime);
neutralM.property("ADBE Transform Group").property("Opacity").setInterpolationTypeAtKey(keyIndex, KeyframeInterpolationType.HOLD, KeyframeInterpolationType.HOLD);
sadM.property("ADBE Transform Group").property("Opacity").setValueAtTime(curTime,0);
var keyIndex = sadM.property("ADBE Transform Group").property("Opacity").nearestKeyIndex(curTime);
sadM.property("ADBE Transform Group").property("Opacity").setInterpolationTypeAtKey(keyIndex, KeyframeInterpolationType.HOLD, KeyframeInterpolationType.HOLD);
angryM.property("ADBE Transform Group").property("Opacity").setValueAtTime(curTime,100);
var keyIndex = angryM.property("ADBE Transform Group").property("Opacity").nearestKeyIndex(curTime);
angryM.property("ADBE Transform Group").property("Opacity").setInterpolationTypeAtKey(keyIndex, KeyframeInterpolationType.HOLD, KeyframeInterpolationType.HOLD);
smileyM.property("ADBE Transform Group").property("Opacity").setValueAtTime(curTime,0);
var keyIndex = smileyM.property("ADBE Transform Group").property("Opacity").nearestKeyIndex(curTime);
smileyM.property("ADBE Transform Group").property("Opacity").setInterpolationTypeAtKey(keyIndex, KeyframeInterpolationType.HOLD, KeyframeInterpolationType.HOLD);
surprisedM.property("ADBE Transform Group").property("Opacity").setValueAtTime(curTime,0);
var keyIndex = surprisedM.property("ADBE Transform Group").property("Opacity").nearestKeyIndex(curTime);
surprisedM.property("ADBE Transform Group").property("Opacity").setInterpolationTypeAtKey(keyIndex, KeyframeInterpolationType.HOLD, KeyframeInterpolationType.HOLD);
}
bttnSmileyM.onClick = function () {
var curTime = app.project.activeItem.time;
happyM.property("ADBE Transform Group").property("Opacity").setValueAtTime(curTime,0);
var keyIndex = happyM.property("ADBE Transform Group").property("Opacity").nearestKeyIndex(curTime);
happyM.property("ADBE Transform Group").property("Opacity").setInterpolationTypeAtKey(keyIndex, KeyframeInterpolationType.HOLD, KeyframeInterpolationType.HOLD);
neutralM.property("ADBE Transform Group").property("Opacity").setValueAtTime(curTime,0);
var keyIndex = neutralM.property("ADBE Transform Group").property("Opacity").nearestKeyIndex(curTime);
neutralM.property("ADBE Transform Group").property("Opacity").setInterpolationTypeAtKey(keyIndex, KeyframeInterpolationType.HOLD, KeyframeInterpolationType.HOLD);
sadM.property("ADBE Transform Group").property("Opacity").setValueAtTime(curTime,0);
var keyIndex = sadM.property("ADBE Transform Group").property("Opacity").nearestKeyIndex(curTime);
sadM.property("ADBE Transform Group").property("Opacity").setInterpolationTypeAtKey(keyIndex, KeyframeInterpolationType.HOLD, KeyframeInterpolationType.HOLD);
angryM.property("ADBE Transform Group").property("Opacity").setValueAtTime(curTime,0);
var keyIndex = angryM.property("ADBE Transform Group").property("Opacity").nearestKeyIndex(curTime);
angryM.property("ADBE Transform Group").property("Opacity").setInterpolationTypeAtKey(keyIndex, KeyframeInterpolationType.HOLD, KeyframeInterpolationType.HOLD);
smileyM.property("ADBE Transform Group").property("Opacity").setValueAtTime(curTime,100);
var keyIndex = smileyM.property("ADBE Transform Group").property("Opacity").nearestKeyIndex(curTime);
smileyM.property("ADBE Transform Group").property("Opacity").setInterpolationTypeAtKey(keyIndex, KeyframeInterpolationType.HOLD, KeyframeInterpolationType.HOLD);
surprisedM.property("ADBE Transform Group").property("Opacity").setValueAtTime(curTime,0);
var keyIndex = surprisedM.property("ADBE Transform Group").property("Opacity").nearestKeyIndex(curTime);
surprisedM.property("ADBE Transform Group").property("Opacity").setInterpolationTypeAtKey(keyIndex, KeyframeInterpolationType.HOLD, KeyframeInterpolationType.HOLD);
}
bttnSurprisedM.onClick = function () {
var curTime = app.project.activeItem.time;
happyM.property("ADBE Transform Group").property("Opacity").setValueAtTime(curTime,0);
var keyIndex = happyM.property("ADBE Transform Group").property("Opacity").nearestKeyIndex(curTime);
happyM.property("ADBE Transform Group").property("Opacity").setInterpolationTypeAtKey(keyIndex, KeyframeInterpolationType.HOLD, KeyframeInterpolationType.HOLD);
neutralM.property("ADBE Transform Group").property("Opacity").setValueAtTime(curTime,0);
var keyIndex = neutralM.property("ADBE Transform Group").property("Opacity").nearestKeyIndex(curTime);
neutralM.property("ADBE Transform Group").property("Opacity").setInterpolationTypeAtKey(keyIndex, KeyframeInterpolationType.HOLD, KeyframeInterpolationType.HOLD);
sadM.property("ADBE Transform Group").property("Opacity").setValueAtTime(curTime,0);
var keyIndex = sadM.property("ADBE Transform Group").property("Opacity").nearestKeyIndex(curTime);
sadM.property("ADBE Transform Group").property("Opacity").setInterpolationTypeAtKey(keyIndex, KeyframeInterpolationType.HOLD, KeyframeInterpolationType.HOLD);
angryM.property("ADBE Transform Group").property("Opacity").setValueAtTime(curTime,0);
var keyIndex = angryM.property("ADBE Transform Group").property("Opacity").nearestKeyIndex(curTime);
angryM.property("ADBE Transform Group").property("Opacity").setInterpolationTypeAtKey(keyIndex, KeyframeInterpolationType.HOLD, KeyframeInterpolationType.HOLD);
smileyM.property("ADBE Transform Group").property("Opacity").setValueAtTime(curTime,0);
var keyIndex = smileyM.property("ADBE Transform Group").property("Opacity").nearestKeyIndex(curTime);
smileyM.property("ADBE Transform Group").property("Opacity").setInterpolationTypeAtKey(keyIndex, KeyframeInterpolationType.HOLD, KeyframeInterpolationType.HOLD);
surprisedM.property("ADBE Transform Group").property("Opacity").setValueAtTime(curTime,100);
var keyIndex = surprisedM.property("ADBE Transform Group").property("Opacity").nearestKeyIndex(curTime);
surprisedM.property("ADBE Transform Group").property("Opacity").setInterpolationTypeAtKey(keyIndex, KeyframeInterpolationType.HOLD, KeyframeInterpolationType.HOLD);
}
This is the code with some "dockable panel" stuff in it which I copied from another working script:
(function(thisObj) {
var scriptPalette = scriptBuildUI(thisObj);
if (scriptPalette !== null && scriptPalette instanceof Window) {
scriptPalette.center();
scriptPalette.show();
} else {
scriptPalette.layout.layout(true);
}
function scriptBuildUI(thisObj) {
//UI Creation
var myWindow = (thisObj instanceof Panel) ? thisObj : new Window("palette", prefs.script.name, undefined, {resizeable: true});
var slct = app.project.activeItem;
////////////////////////////////////////////---face (eyes) drop-down menu---select layers
var groupOne = myWindow.add("group", undefined, "GroupOne");
groupOne.orientation = "column";
groupOne.add("statictext", undefined, "Neutral face layer");
var ddNeutral = groupOne.add("dropdownlist", undefined, [slct.layer(1).name, slct.layer(2).name, slct.layer(3).name, slct.layer(4).name, slct.layer(5).name, slct.layer(6).name, slct.layer(7).name, slct.layer(8).name, slct.layer(9).name, slct.layer(10).name, slct.layer(11).name, slct.layer(12).name, slct.layer(13).name]);
groupOne.add("statictext", undefined, "Angry face layer");
var ddAngry = groupOne.add("dropdownlist", undefined, [slct.layer(1).name, slct.layer(2).name, slct.layer(3).name, slct.layer(4).name, slct.layer(5).name, slct.layer(6).name, slct.layer(7).name, slct.layer(8).name, slct.layer(9).name, slct.layer(10).name, slct.layer(11).name, slct.layer(12).name, slct.layer(13).name]);
groupOne.add("statictext", undefined, "Sad face layer");
var ddSad = groupOne.add("dropdownlist", undefined, [slct.layer(1).name, slct.layer(2).name, slct.layer(3).name, slct.layer(4).name, slct.layer(5).name, slct.layer(6).name, slct.layer(7).name, slct.layer(8).name, slct.layer(9).name, slct.layer(10).name, slct.layer(11).name, slct.layer(12).name, slct.layer(13).name]);
////////////////////////////////////////////---face (eyes) buttons
var groupTwo = myWindow.add("group", undefined, "GroupTwo");
groupTwo.orientation = "column";
var bttnNeutral = groupTwo.add("button", undefined, "neutral face");
var bttnAngry = groupTwo.add("button", undefined, "angry face");
var bttnSad = groupTwo.add("button", undefined, "sad face");
///////////////////////////////////////////---mouth drop-down menu---select layers
var groupThree = myWindow.add("group", undefined, "GroupThree");
groupThree.orientation = "column";
groupThree.add("statictext", undefined, "Happy mouth layer");
var ddHappyM = groupThree.add("dropdownlist", undefined, [slct.layer(1).name, slct.layer(2).name, slct.layer(3).name, slct.layer(4).name, slct.layer(5).name, slct.layer(6).name, slct.layer(7).name, slct.layer(8).name, slct.layer(9).name, slct.layer(10).name, slct.layer(11).name, slct.layer(12).name, slct.layer(13).name]);
groupThree.add("statictext", undefined, "Neutral mouth layer");
var ddNeutralM = groupThree.add("dropdownlist", undefined, [slct.layer(1).name, slct.layer(2).name, slct.layer(3).name, slct.layer(4).name, slct.layer(5).name, slct.layer(6).name, slct.layer(7).name, slct.layer(8).name, slct.layer(9).name, slct.layer(10).name, slct.layer(11).name, slct.layer(12).name, slct.layer(13).name]);
groupThree.add("statictext", undefined, "Sad mouth layer");
var ddSadM = groupThree.add("dropdownlist", undefined, [slct.layer(1).name, slct.layer(2).name, slct.layer(3).name, slct.layer(4).name, slct.layer(5).name, slct.layer(6).name, slct.layer(7).name, slct.layer(8).name, slct.layer(9).name, slct.layer(10).name, slct.layer(11).name, slct.layer(12).name, slct.layer(13).name]);
groupThree.add("statictext", undefined, "Angry mouth layer");
var ddAngryM = groupThree.add("dropdownlist", undefined, [slct.layer(1).name, slct.layer(2).name, slct.layer(3).name, slct.layer(4).name, slct.layer(5).name, slct.layer(6).name, slct.layer(7).name, slct.layer(8).name, slct.layer(9).name, slct.layer(10).name, slct.layer(11).name, slct.layer(12).name, slct.layer(13).name]);
groupThree.add("statictext", undefined, "Smiley mouth layer");
var ddSmileyM = groupThree.add("dropdownlist", undefined, [slct.layer(1).name, slct.layer(2).name, slct.layer(3).name, slct.layer(4).name, slct.layer(5).name, slct.layer(6).name, slct.layer(7).name, slct.layer(8).name, slct.layer(9).name, slct.layer(10).name, slct.layer(11).name, slct.layer(12).name, slct.layer(13).name]);
groupThree.add("statictext", undefined, "Surprised mouth layer");
var ddSurprisedM = groupThree.add("dropdownlist", undefined, [slct.layer(1).name, slct.layer(2).name, slct.layer(3).name, slct.layer(4).name, slct.layer(5).name, slct.layer(6).name, slct.layer(7).name, slct.layer(8).name, slct.layer(9).name, slct.layer(10).name, slct.layer(11).name, slct.layer(12).name, slct.layer(13).name]);
////////////////////////////////////////////---mouth buttons
var groupFour = myWindow.add("group", undefined, "GroupFour");
groupFour.orientation = "column";
var bttnHappyM = groupFour.add("button", undefined, "happy mouth");
var bttnNeutralM = groupFour.add("button", undefined, "neutral mouth");
var bttnSadM = groupFour.add("button", undefined, "sad mouth");
var bttnAngryM = groupFour.add("button", undefined, "angry mouth");
var bttnSmileyM = groupFour.add("button", undefined, "smiley mouth");
var bttnSurprisedM = groupFour.add("button", undefined, "surprised mouth");
//UI CREATION END
alert("Select layers before clicking OK"); //remove
var neutral = slct.layer(ddNeutral.selection.index + 1);
var angry = slct.layer(ddAngry.selection.index + 1);
var sad = slct.layer(ddSad.selection.index + 1);
var happyM = slct.layer(ddHappyM.selection.index + 1);
var neutralM = slct.layer(ddNeutralM.selection.index + 1);
var sadM = slct.layer(ddSadM.selection.index + 1);
var angryM = slct.layer(ddAngryM.selection.index + 1);
var smileyM = slct.layer(ddSmileyM.selection.index + 1);
var surprisedM = slct.layer(ddSurprisedM.selection.index + 1);
bttnNeutral.onClick = function () {
var curTime = app.project.activeItem.time;
app.beginUndoGroup("Face expression");
neutral.property("ADBE Transform Group").property("Opacity").setValueAtTime(curTime,100);
var keyIndex = neutral.property("ADBE Transform Group").property("Opacity").nearestKeyIndex(curTime);
neutral.property("ADBE Transform Group").property("Opacity").setInterpolationTypeAtKey(keyIndex, KeyframeInterpolationType.HOLD, KeyframeInterpolationType.HOLD);
angry.property("ADBE Transform Group").property("Opacity").setValueAtTime(curTime,0);
var keyIndex = angry.property("ADBE Transform Group").property("Opacity").nearestKeyIndex(curTime);
angry.property("ADBE Transform Group").property("Opacity").setInterpolationTypeAtKey(keyIndex, KeyframeInterpolationType.HOLD, KeyframeInterpolationType.HOLD);
sad.property("ADBE Transform Group").property("Opacity").setValueAtTime(curTime,0);
var keyIndex = sad.property("ADBE Transform Group").property("Opacity").nearestKeyIndex(curTime);
sad.property("ADBE Transform Group").property("Opacity").setInterpolationTypeAtKey(keyIndex, KeyframeInterpolationType.HOLD, KeyframeInterpolationType.HOLD);
}
bttnAngry.onClick = function () {
var curTime = app.project.activeItem.time;
app.beginUndoGroup("Face expression");
neutral.property("ADBE Transform Group").property("Opacity").setValueAtTime(curTime,0);
var keyIndex = neutral.property("ADBE Transform Group").property("Opacity").nearestKeyIndex(curTime);
neutral.property("ADBE Transform Group").property("Opacity").setInterpolationTypeAtKey(keyIndex, KeyframeInterpolationType.HOLD, KeyframeInterpolationType.HOLD);
angry.property("ADBE Transform Group").property("Opacity").setValueAtTime(curTime,100);
var keyIndex = angry.property("ADBE Transform Group").property("Opacity").nearestKeyIndex(curTime);
angry.property("ADBE Transform Group").property("Opacity").setInterpolationTypeAtKey(keyIndex, KeyframeInterpolationType.HOLD, KeyframeInterpolationType.HOLD);
sad.property("ADBE Transform Group").property("Opacity").setValueAtTime(curTime,0);
var keyIndex = sad.property("ADBE Transform Group").property("Opacity").nearestKeyIndex(curTime);
sad.property("ADBE Transform Group").property("Opacity").setInterpolationTypeAtKey(keyIndex, KeyframeInterpolationType.HOLD, KeyframeInterpolationType.HOLD);
}
bttnSad.onClick = function () {
var curTime = app.project.activeItem.time;
app.beginUndoGroup("Face expression");
neutral.property("ADBE Transform Group").property("Opacity").setValueAtTime(curTime,0);
var keyIndex = neutral.property("ADBE Transform Group").property("Opacity").nearestKeyIndex(curTime);
neutral.property("ADBE Transform Group").property("Opacity").setInterpolationTypeAtKey(keyIndex, KeyframeInterpolationType.HOLD, KeyframeInterpolationType.HOLD);
angry.property("ADBE Transform Group").property("Opacity").setValueAtTime(curTime,0);
var keyIndex = angry.property("ADBE Transform Group").property("Opacity").nearestKeyIndex(curTime);
angry.property("ADBE Transform Group").property("Opacity").setInterpolationTypeAtKey(keyIndex, KeyframeInterpolationType.HOLD, KeyframeInterpolationType.HOLD);
sad.property("ADBE Transform Group").property("Opacity").setValueAtTime(curTime,100);
var keyIndex = sad.property("ADBE Transform Group").property("Opacity").nearestKeyIndex(curTime);
sad.property("ADBE Transform Group").property("Opacity").setInterpolationTypeAtKey(keyIndex, KeyframeInterpolationType.HOLD, KeyframeInterpolationType.HOLD);
}
bttnHappyM.onClick = function () {
var curTime = app.project.activeItem.time;
app.beginUndoGroup("Mouth expression");
happyM.property("ADBE Transform Group").property("Opacity").setValueAtTime(curTime,100);
var keyIndex = happyM.property("ADBE Transform Group").property("Opacity").nearestKeyIndex(curTime);
happyM.property("ADBE Transform Group").property("Opacity").setInterpolationTypeAtKey(keyIndex, KeyframeInterpolationType.HOLD, KeyframeInterpolationType.HOLD);
neutralM.property("ADBE Transform Group").property("Opacity").setValueAtTime(curTime,0);
var keyIndex = neutralM.property("ADBE Transform Group").property("Opacity").nearestKeyIndex(curTime);
neutralM.property("ADBE Transform Group").property("Opacity").setInterpolationTypeAtKey(keyIndex, KeyframeInterpolationType.HOLD, KeyframeInterpolationType.HOLD);
sadM.property("ADBE Transform Group").property("Opacity").setValueAtTime(curTime,0);
var keyIndex = sadM.property("ADBE Transform Group").property("Opacity").nearestKeyIndex(curTime);
sadM.property("ADBE Transform Group").property("Opacity").setInterpolationTypeAtKey(keyIndex, KeyframeInterpolationType.HOLD, KeyframeInterpolationType.HOLD);
angryM.property("ADBE Transform Group").property("Opacity").setValueAtTime(curTime,0);
var keyIndex = angryM.property("ADBE Transform Group").property("Opacity").nearestKeyIndex(curTime);
angryM.property("ADBE Transform Group").property("Opacity").setInterpolationTypeAtKey(keyIndex, KeyframeInterpolationType.HOLD, KeyframeInterpolationType.HOLD);
smileyM.property("ADBE Transform Group").property("Opacity").setValueAtTime(curTime,0);
var keyIndex = smileyM.property("ADBE Transform Group").property("Opacity").nearestKeyIndex(curTime);
smileyM.property("ADBE Transform Group").property("Opacity").setInterpolationTypeAtKey(keyIndex, KeyframeInterpolationType.HOLD, KeyframeInterpolationType.HOLD);
surprisedM.property("ADBE Transform Group").property("Opacity").setValueAtTime(curTime,0);
var keyIndex = surprisedM.property("ADBE Transform Group").property("Opacity").nearestKeyIndex(curTime);
surprisedM.property("ADBE Transform Group").property("Opacity").setInterpolationTypeAtKey(keyIndex, KeyframeInterpolationType.HOLD, KeyframeInterpolationType.HOLD);
app.endUndoGroup();
}
bttnNeutralM.onClick = function () {
var curTime = app.project.activeItem.time;
app.beginUndoGroup("Mouth expression");
happyM.property("ADBE Transform Group").property("Opacity").setValueAtTime(curTime,0);
var keyIndex = happyM.property("ADBE Transform Group").property("Opacity").nearestKeyIndex(curTime);
happyM.property("ADBE Transform Group").property("Opacity").setInterpolationTypeAtKey(keyIndex, KeyframeInterpolationType.HOLD, KeyframeInterpolationType.HOLD);
neutralM.property("ADBE Transform Group").property("Opacity").setValueAtTime(curTime,100);
var keyIndex = neutralM.property("ADBE Transform Group").property("Opacity").nearestKeyIndex(curTime);
neutralM.property("ADBE Transform Group").property("Opacity").setInterpolationTypeAtKey(keyIndex, KeyframeInterpolationType.HOLD, KeyframeInterpolationType.HOLD);
sadM.property("ADBE Transform Group").property("Opacity").setValueAtTime(curTime,0);
var keyIndex = sadM.property("ADBE Transform Group").property("Opacity").nearestKeyIndex(curTime);
sadM.property("ADBE Transform Group").property("Opacity").setInterpolationTypeAtKey(keyIndex, KeyframeInterpolationType.HOLD, KeyframeInterpolationType.HOLD);
angryM.property("ADBE Transform Group").property("Opacity").setValueAtTime(curTime,0);
var keyIndex = angryM.property("ADBE Transform Group").property("Opacity").nearestKeyIndex(curTime);
angryM.property("ADBE Transform Group").property("Opacity").setInterpolationTypeAtKey(keyIndex, KeyframeInterpolationType.HOLD, KeyframeInterpolationType.HOLD);
smileyM.property("ADBE Transform Group").property("Opacity").setValueAtTime(curTime,0);
var keyIndex = smileyM.property("ADBE Transform Group").property("Opacity").nearestKeyIndex(curTime);
smileyM.property("ADBE Transform Group").property("Opacity").setInterpolationTypeAtKey(keyIndex, KeyframeInterpolationType.HOLD, KeyframeInterpolationType.HOLD);
surprisedM.property("ADBE Transform Group").property("Opacity").setValueAtTime(curTime,0);
var keyIndex = surprisedM.property("ADBE Transform Group").property("Opacity").nearestKeyIndex(curTime);
surprisedM.property("ADBE Transform Group").property("Opacity").setInterpolationTypeAtKey(keyIndex, KeyframeInterpolationType.HOLD, KeyframeInterpolationType.HOLD);
app.endUndoGroup();
}
bttnSadM.onClick = function () {
var curTime = app.project.activeItem.time;
app.beginUndoGroup("Mouth expression");
happyM.property("ADBE Transform Group").property("Opacity").setValueAtTime(curTime,0);
var keyIndex = happyM.property("ADBE Transform Group").property("Opacity").nearestKeyIndex(curTime);
happyM.property("ADBE Transform Group").property("Opacity").setInterpolationTypeAtKey(keyIndex, KeyframeInterpolationType.HOLD, KeyframeInterpolationType.HOLD);
neutralM.property("ADBE Transform Group").property("Opacity").setValueAtTime(curTime,0);
var keyIndex = neutralM.property("ADBE Transform Group").property("Opacity").nearestKeyIndex(curTime);
neutralM.property("ADBE Transform Group").property("Opacity").setInterpolationTypeAtKey(keyIndex, KeyframeInterpolationType.HOLD, KeyframeInterpolationType.HOLD);
sadM.property("ADBE Transform Group").property("Opacity").setValueAtTime(curTime,100);
var keyIndex = sadM.property("ADBE Transform Group").property("Opacity").nearestKeyIndex(curTime);
sadM.property("ADBE Transform Group").property("Opacity").setInterpolationTypeAtKey(keyIndex, KeyframeInterpolationType.HOLD, KeyframeInterpolationType.HOLD);
angryM.property("ADBE Transform Group").property("Opacity").setValueAtTime(curTime,0);
var keyIndex = angryM.property("ADBE Transform Group").property("Opacity").nearestKeyIndex(curTime);
angryM.property("ADBE Transform Group").property("Opacity").setInterpolationTypeAtKey(keyIndex, KeyframeInterpolationType.HOLD, KeyframeInterpolationType.HOLD);
smileyM.property("ADBE Transform Group").property("Opacity").setValueAtTime(curTime,0);
var keyIndex = smileyM.property("ADBE Transform Group").property("Opacity").nearestKeyIndex(curTime);
smileyM.property("ADBE Transform Group").property("Opacity").setInterpolationTypeAtKey(keyIndex, KeyframeInterpolationType.HOLD, KeyframeInterpolationType.HOLD);
surprisedM.property("ADBE Transform Group").property("Opacity").setValueAtTime(curTime,0);
var keyIndex = surprisedM.property("ADBE Transform Group").property("Opacity").nearestKeyIndex(curTime);
surprisedM.property("ADBE Transform Group").property("Opacity").setInterpolationTypeAtKey(keyIndex, KeyframeInterpolationType.HOLD, KeyframeInterpolationType.HOLD);
app.endUndoGroup();
}
bttnAngryM.onClick = function () {
var curTime = app.project.activeItem.time;
app.beginUndoGroup("Mouth expression");
happyM.property("ADBE Transform Group").property("Opacity").setValueAtTime(curTime,0);
var keyIndex = happyM.property("ADBE Transform Group").property("Opacity").nearestKeyIndex(curTime);
happyM.property("ADBE Transform Group").property("Opacity").setInterpolationTypeAtKey(keyIndex, KeyframeInterpolationType.HOLD, KeyframeInterpolationType.HOLD);
neutralM.property("ADBE Transform Group").property("Opacity").setValueAtTime(curTime,0);
var keyIndex = neutralM.property("ADBE Transform Group").property("Opacity").nearestKeyIndex(curTime);
neutralM.property("ADBE Transform Group").property("Opacity").setInterpolationTypeAtKey(keyIndex, KeyframeInterpolationType.HOLD, KeyframeInterpolationType.HOLD);
sadM.property("ADBE Transform Group").property("Opacity").setValueAtTime(curTime,0);
var keyIndex = sadM.property("ADBE Transform Group").property("Opacity").nearestKeyIndex(curTime);
sadM.property("ADBE Transform Group").property("Opacity").setInterpolationTypeAtKey(keyIndex, KeyframeInterpolationType.HOLD, KeyframeInterpolationType.HOLD);
angryM.property("ADBE Transform Group").property("Opacity").setValueAtTime(curTime,100);
var keyIndex = angryM.property("ADBE Transform Group").property("Opacity").nearestKeyIndex(curTime);
angryM.property("ADBE Transform Group").property("Opacity").setInterpolationTypeAtKey(keyIndex, KeyframeInterpolationType.HOLD, KeyframeInterpolationType.HOLD);
smileyM.property("ADBE Transform Group").property("Opacity").setValueAtTime(curTime,0);
var keyIndex = smileyM.property("ADBE Transform Group").property("Opacity").nearestKeyIndex(curTime);
smileyM.property("ADBE Transform Group").property("Opacity").setInterpolationTypeAtKey(keyIndex, KeyframeInterpolationType.HOLD, KeyframeInterpolationType.HOLD);
surprisedM.property("ADBE Transform Group").property("Opacity").setValueAtTime(curTime,0);
var keyIndex = surprisedM.property("ADBE Transform Group").property("Opacity").nearestKeyIndex(curTime);
surprisedM.property("ADBE Transform Group").property("Opacity").setInterpolationTypeAtKey(keyIndex, KeyframeInterpolationType.HOLD, KeyframeInterpolationType.HOLD);
app.endUndoGroup();
}
bttnSmileyM.onClick = function () {
var curTime = app.project.activeItem.time;
app.beginUndoGroup("Mouth expression");
happyM.property("ADBE Transform Group").property("Opacity").setValueAtTime(curTime,0);
var keyIndex = happyM.property("ADBE Transform Group").property("Opacity").nearestKeyIndex(curTime);
happyM.property("ADBE Transform Group").property("Opacity").setInterpolationTypeAtKey(keyIndex, KeyframeInterpolationType.HOLD, KeyframeInterpolationType.HOLD);
neutralM.property("ADBE Transform Group").property("Opacity").setValueAtTime(curTime,0);
var keyIndex = neutralM.property("ADBE Transform Group").property("Opacity").nearestKeyIndex(curTime);
neutralM.property("ADBE Transform Group").property("Opacity").setInterpolationTypeAtKey(keyIndex, KeyframeInterpolationType.HOLD, KeyframeInterpolationType.HOLD);
sadM.property("ADBE Transform Group").property("Opacity").setValueAtTime(curTime,0);
var keyIndex = sadM.property("ADBE Transform Group").property("Opacity").nearestKeyIndex(curTime);
sadM.property("ADBE Transform Group").property("Opacity").setInterpolationTypeAtKey(keyIndex, KeyframeInterpolationType.HOLD, KeyframeInterpolationType.HOLD);
angryM.property("ADBE Transform Group").property("Opacity").setValueAtTime(curTime,0);
var keyIndex = angryM.property("ADBE Transform Group").property("Opacity").nearestKeyIndex(curTime);
angryM.property("ADBE Transform Group").property("Opacity").setInterpolationTypeAtKey(keyIndex, KeyframeInterpolationType.HOLD, KeyframeInterpolationType.HOLD);
smileyM.property("ADBE Transform Group").property("Opacity").setValueAtTime(curTime,100);
var keyIndex = smileyM.property("ADBE Transform Group").property("Opacity").nearestKeyIndex(curTime);
smileyM.property("ADBE Transform Group").property("Opacity").setInterpolationTypeAtKey(keyIndex, KeyframeInterpolationType.HOLD, KeyframeInterpolationType.HOLD);
surprisedM.property("ADBE Transform Group").property("Opacity").setValueAtTime(curTime,0);
var keyIndex = surprisedM.property("ADBE Transform Group").property("Opacity").nearestKeyIndex(curTime);
surprisedM.property("ADBE Transform Group").property("Opacity").setInterpolationTypeAtKey(keyIndex, KeyframeInterpolationType.HOLD, KeyframeInterpolationType.HOLD);
app.endUndoGroup();
}
bttnSurprisedM.onClick = function () {
var curTime = app.project.activeItem.time;
app.beginUndoGroup("Mouth expression");
happyM.property("ADBE Transform Group").property("Opacity").setValueAtTime(curTime,0);
var keyIndex = happyM.property("ADBE Transform Group").property("Opacity").nearestKeyIndex(curTime);
happyM.property("ADBE Transform Group").property("Opacity").setInterpolationTypeAtKey(keyIndex, KeyframeInterpolationType.HOLD, KeyframeInterpolationType.HOLD);
neutralM.property("ADBE Transform Group").property("Opacity").setValueAtTime(curTime,0);
var keyIndex = neutralM.property("ADBE Transform Group").property("Opacity").nearestKeyIndex(curTime);
neutralM.property("ADBE Transform Group").property("Opacity").setInterpolationTypeAtKey(keyIndex, KeyframeInterpolationType.HOLD, KeyframeInterpolationType.HOLD);
sadM.property("ADBE Transform Group").property("Opacity").setValueAtTime(curTime,0);
var keyIndex = sadM.property("ADBE Transform Group").property("Opacity").nearestKeyIndex(curTime);
sadM.property("ADBE Transform Group").property("Opacity").setInterpolationTypeAtKey(keyIndex, KeyframeInterpolationType.HOLD, KeyframeInterpolationType.HOLD);
angryM.property("ADBE Transform Group").property("Opacity").setValueAtTime(curTime,0);
var keyIndex = angryM.property("ADBE Transform Group").property("Opacity").nearestKeyIndex(curTime);
angryM.property("ADBE Transform Group").property("Opacity").setInterpolationTypeAtKey(keyIndex, KeyframeInterpolationType.HOLD, KeyframeInterpolationType.HOLD);
smileyM.property("ADBE Transform Group").property("Opacity").setValueAtTime(curTime,0);
var keyIndex = smileyM.property("ADBE Transform Group").property("Opacity").nearestKeyIndex(curTime);
smileyM.property("ADBE Transform Group").property("Opacity").setInterpolationTypeAtKey(keyIndex, KeyframeInterpolationType.HOLD, KeyframeInterpolationType.HOLD);
surprisedM.property("ADBE Transform Group").property("Opacity").setValueAtTime(curTime,100);
var keyIndex = surprisedM.property("ADBE Transform Group").property("Opacity").nearestKeyIndex(curTime);
surprisedM.property("ADBE Transform Group").property("Opacity").setInterpolationTypeAtKey(keyIndex, KeyframeInterpolationType.HOLD, KeyframeInterpolationType.HOLD);
app.endUndoGroup();
}
return myWindow;
} //UI Creation End.//
})(this);