Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Script working in test environments but not After Effects

Participant ,
Sep 19, 2019 Sep 19, 2019

I've just written and tested my first dockable scriptUI with Visual Studio Code + ExtendScript Debugger. Everything was working well so I put the .jsx file in my AE 2019 ScriptUI Panels folder, restarted After Effects, and attempted in vain to launch it from within the app.

 

AE throws the error "unable to execute script at line 2. Execution halted", which launches the ExtendScript Toolkit debugger, revealing the error to be "show is undefined." Here's the snippet of code:

 

 

 

 

var myUI = createUI(this);
myUI.show();
// CREATE UI PANEL
function createUI(thisObj) {
var myPanel = (thisObj instanceof Panel) ? thisObj : new Window("palette", "B-roll Autopilot", undefined, {resizeable:true, closeButton:true});

 

 

 

 

Strangely, there is no such error when I launch the script from the ExtendScript Toolkit, VSC or Atom.

 

Any idea what's going on? Tomas?

TOPICS
Scripting
823
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Advocate , Sep 20, 2019 Sep 20, 2019

Can you upload full code? This snippet doesn't really help much.

 

In case you need a boilerplate for creating dockable panels, here's what I use in all my tools:

(function (thisObj) {
	buildUI(thisObj);

	function buildUI(thisObj) {
		var win = (thisObj instanceof Panel) ? thisObj : new Window("palette", "script", undefined, {
			resizeable: true
		});

		var button = win.add('button', undefined, 'Click me');
		button.onClick = function(){
			alert('Hello World');
		};

		win.onResizing = win.o
...
Translate
Advocate ,
Sep 20, 2019 Sep 20, 2019

Can you upload full code? This snippet doesn't really help much.

 

In case you need a boilerplate for creating dockable panels, here's what I use in all my tools:

(function (thisObj) {
	buildUI(thisObj);

	function buildUI(thisObj) {
		var win = (thisObj instanceof Panel) ? thisObj : new Window("palette", "script", undefined, {
			resizeable: true
		});

		var button = win.add('button', undefined, 'Click me');
		button.onClick = function(){
			alert('Hello World');
		};

		win.onResizing = win.onResize = function () {
			this.layout.resize();
		};

		if (win instanceof Window) {
			win.center();
			win.show();
		} else {
			win.layout.layout(true);
			win.layout.resize();
		}
	}

})(this);
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Sep 23, 2019 Sep 23, 2019
LATEST

Hey, Tomas! I updated my code with your boilerplate and it's working now.

 

THANK YOU.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines