Skip to content

Commit 9ce78c4

Browse files
author
fabiantheblind
committed
bridge talk and others
1 parent df5add7 commit 9ce78c4

File tree

4 files changed

+4
-0
lines changed

4 files changed

+4
-0
lines changed

aTestScript.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/*needs som additional data from the outside*/(function(thisObj){fun();function fun(){app.beginUndoGroup("XXX");var curComp = app.project.activeItem; if (!curComp || !(curComp instanceof CompItem)){ alert("noComp"); return; };alert(info);app.endUndoGroup();}})(this);

bridge-talking.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
var bt = new BridgeTalk(); bt.target = "aftereffects"; var file = File.openDialog ("select a file to read in", "*.jsx", false); if(file !=null){ file.open('r'); var str = file.read();//~ var escapedstr = escape(str); file.close(); var scp = "var info = 'Hello World';\n"; scp+= str; scp += "var bt = new BridgeTalk();\n"; scp += "bt.target = 'estoolkit';\n"; scp += "var msgbody = 'alert(\"Hello ESTK\");'\n"; scp += "bt.body = msgbody;\n"; scp += "bt.send();\n" alert(scp); bt.body = scp; bt.send();//~ alert("bt message send"); }

capsulate-function.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/** * This is not working right. The prototype function is availalble * * @param {[type]} thisObj [description] * @return {[type]} [description] */(function(thisObj){// basic panelrun_distort(thisObj); function run_distort(thisObj){// this is globaldistort_data = { 'x':10, 'y':10};Array.prototype.clear=function(){ this.length = 0; };/// THIS WILL CHECK IF PANEL IS DOCKABLE OR FLAOTING WINDOW var win = buildUI(thisObj );if ((win != null) && (win instanceof Window)) { win.center(); win.show();}; // end if win null and not a instance of window function buildUI (thisObj ) { var win = (thisObj instanceof Panel) ? thisObj : new Window('palette', 'example with proto',[0,0,150,260],{resizeable: true}); if (win != null) { var H = 25; // the height var W = 30; // the width var G = 5; // the gutter var x = G; var y = G; // win.check_box = win.add('checkbox',[x,y,x+W*2,y + H],'check'); // win.check_box.value = metaObject.setting1; win.doit_button = win.add('button', [x ,y,x+W*3,y + H], 'do it'); // win.up_button = win.add('button', [x + W*5+ G,y,x + W*6,y + H], 'Up'); // win.check_box.onClick = function (){ // alert("check"); // }; win.doit_button.onClick = function () { distort(); }; } return win}function distort(){// "in function main. From here on it is a straight run"// var curComp = app.project.activeItem; if (!curComp || !(curComp instanceof CompItem)){ alert('please select a comp'); return; } if(curComp.selectedLayers.length < 1){ alert('Please select at least one layer'); return; } app.beginUndoGroup('open-close-mask'); var props = curComp.selectedProperties app.endUndoGroup();}; };// close run_distort})(this);

find command id.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
 var res = app.findMenuCommandId("Neue Maske"); alert(res); app.executeCommand(res); // 2367 : app.findMenuCommandId("New Mask")

0 commit comments

Comments
 (0)