Work in Progress¶
Table of Contents
Recent Searches¶
- Progressbar estk.aenhancers
- ShortcutKey estk.aenhancers
- Event Handling estk.aenhancers
- Layer applyPreset estk.aenhancers
- AVLayer autoOrient estk.aenhancers
- AVLayer source estk.aenhancers
- AVLayer replaceSource estk.aenhancers
- AVLayer sourceRectAtTime estk.aenhancers
- NumericEditKeyboardHandler
- Addeventlistener vs OnClick attribute
- Script Console Script
In Progress¶
- Console: Paste keyframe functionality
- Console: Parse multiline input (slices, markers, keyframes/Mocha)
- Console: Switch with UP and DOWN key through the console history
- Using the up and down arrow keys to change numerical data page 99 in scriptui PDF
function handle_key (key, control)
{
var step;
key.shiftKey ? step = 10 : step = 1;
switch (key.keyName)
{
case "Up": control.text = String(Number(control.text)+step); break;
case "Down": control.text = String(Number(control.text)-step);
}
} // handle_key
e1.addEventListener ("keydown", function (k) {handle_key (k, this);});
e2.addEventListener ("keydown", function (k) {handle_key (k, this);});
controlObj.addEventListener('change', handler, capturePhase);
controlObj.addEventListener('changing', handler, capturePhase);
controlObj.addEventListener('focus', handler, capturePhase);
controlObj.addEventListener('enterKey', handler, capturePhase);
stopPropagation();
preventDefault();
- stopPropagation()
- preventDefault()
- Example: onActivate(), onDeactivate() page 103 in scriptui PDF
ddown.onActivate = ddown.onDeactivate = function () {buffer = "";}
- Validating Input, edittext with red background `page 104 in scriptui PDF`_
w.input.onChanging = function () {
w.ok.enabled = !app.activeDocument.hyperlinkTextDestinations.item
(w.input.text).isValid;
}
w.input.onChanging = function () {
var valid = /^[\d.,]+$/.test (w.input.text);
this.graphics.backgroundColor = this.graphics.newBrush (this.graphics.BrushType.
SOLID_COLOR, valid ? [1, 1, 1, 1] : [1, 0.5, 0.5, 1]);
w.ok.enabled = valid;
}
- own display alert message with edit text scriptui-2-13-f-2017
// create an example array
array = [];
for (i = 0; i < 150; i++)
array.push ("Line " + String (i));
alert_scroll ("Example", array);
function alert_scroll (title, input) // string, string/array
{
// if input is an array, convert it to a string
if (input instanceof Array)
input = input.join ("\r");
var w = new Window ("dialog", title);
var list = w.add ("edittext", undefined, input, {multiline: true, scrolling: true});
// the list should not be taller than the maximum possible height of the window
list.maximumSize.height = w.maximumSize.height - 100;
list.minimumSize.width = 150;
w.add ("button", undefined, "Close", {name: "ok"});
w.show ();
}
- edittext syntax highlighting/coloring, marker, slice
- Add reveal preferences button to GUI
Qued¶
- BeatManager: Include bpm edittext and rate dropdownlist directly in class and not in buildGUI function.
- Console: Add expand/collapse button
- Console: Interpret keyframes, remove all keyframes except the ones that are on the beat, interpolate the lasting keyframes in different ways. This should be fun with tracking data i think.
- Create marker label: 1 … 4 … 8 … 12 and 1 … 1 . . . 1 … 1
- Check javascript compatibility ES5 and ES6, new after effects version legacy-and-extend-script-engine:
- New class Keyframes: manage console input
- app.beep(): Sound?
- MouseEvent: event.altKey, ctrlKey, metaKey, shiftKey; event.screenX/Y, type == “mousedown”; initMouseEvent()
- KeyboardEvent: event.getModifierState(key); key == “Alt”, “Meta”, “Control”, “Shift”
- Console functions: create multiple comps
create markers [compName]andcreate slices [compName]⋅⋅* template.xml: A default template for new compositions is saved on disk. New compositions are created by the template data. - edit markers/slices in ‘show’ popup window. remove marker, remove slice
- Quantize keyframes
EventHandling¶
var newEvent = ScriptUI.events.createEvent( "UIEvent" );
//initUIEvent(eventName, bubble, isCancelable, view, detail)
newEvent.initUIEvent( "change", true, true, myControl, 1 );
myControl.dispatchEvent( newEvent );
/*
eventNames:
change, changing, move, moving, resize, resizing, show, enterKey, focus, blur,
mousedown, mouseup, mousemove, mouseover, mouseout, keyup, keydown, click
keyIdentifier:
"Alt", "CapsLock", "Control", "Meta", "NumLock", "Scroll", "Shift"
keyLocation: KeyboardEvent.DOM_KEY_LOCATION_STANDARD
DOM_KEY_LOCATION_STANDARD, DOM_KEY_LOCATION_LEFT, DOM_KEY_LOCATION_RIGHT, DOM_KEY_LOCATION_NUMPAD
*/
var newEvent = ScriptUI.events.createEvent( "KeyboardEvent" );
//newEvent.initKeyboardEvent (eventName, bubble, isCancelable, view, keyID, keyLocation, modifiersList:"Control Alt");
newEvent.initKeyboardEvent ("keydown", true, true, peacockConsole.console, "Enter", 0, "");
peacockConsole.console.dispatchEvent( newEvent );
var newEvent = ScriptUI.events.createEvent( "MouseEvent" );
// var newEvent = initMouseEvent( eventName, bubble, isCancelable, view, detail, screenX, screenY, clientX, clientY, ctrlKey, altKey, shiftKey, metaKey, button, relatedTarge);
myControl.dispatchEvent( newEvent );