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

After Effects CC Script UI issues

Engaged ,
Jul 10, 2013 Jul 10, 2013

Hi there, some information I gleaned from discussions on the Indesign forum.

Might be good to have one thread where various issues are discussed in one place.

Keep in mind these issues being discussed over there are showing up in InDesign not After Effects.

I have not tested these, it's just stuff others are talking about - I have yet to fix my scripts for CC.

So if anybody has info... wishes to discuss....

What people are talking about:

  • The stacking order on Windows has changed to be the same as the Mac's.
  • Horizontal Scrollbar and Vertical missing issue
  • The unenabled icon button show's as the enabled one and some combination of both of them show when unenabled

     - issues with creation properties - toggle

  • Image positions jump (a pixel) sometimes on clicking a radio button and sizes of panels have shrunk
  • Treeview -  http://forums.adobe.com/thread/1235394?tstart=0
  • - issues with foreground and background colors...
  • Script UI fonts and sizes are locked.
  • many events and listeners such as 'focus' or 'onDraw' not work as they did (or are simply discarded);
  • the layout manager 'stack' orientation now causes weird problems;
  • panels with {borderless:true} creation property are not borderless;
  • other widgets don't support ScriptUIPen and ScriptUIBrush customization anymore;
TOPICS
Scripting
19.3K
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
Engaged ,
Jul 11, 2013 Jul 11, 2013

Another, just discovered 'mousemove' event listener is not being triggered.

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
Engaged ,
Jul 14, 2013 Jul 14, 2013

For me  - return key in edittext boxes not being picked up (enterKeySignalsOnChange) - It's just doing nothing.

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 ,
Jul 14, 2013 Jul 14, 2013

Hi Alan, thanks for this list.

2 bugs I mentioned on the forum:

- 'click' and 'mouseup' events not being triggered: http://forums.adobe.com/message/5449261#5449261

- no Flash/Extendscript communication: http://forums.adobe.com/message/5483589

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
Engaged ,
Jul 15, 2013 Jul 15, 2013

Damn - the mousemove event not being triggered means throwing a script in the bin for me!! yikes. Weeks of work down the drain if that's the case.

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
New Here ,
Jul 15, 2013 Jul 15, 2013

You may try to replace calls to addEventListener with a function, like

button.onClick instead of the 'click' event for example

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 ,
Jul 15, 2013 Jul 15, 2013

Of course but that means that older script need to be updated even though nothing is wrong with them. Plus those events are documented in the CC Javascript Guide.

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
Engaged ,
Jul 15, 2013 Jul 15, 2013

Thanks but there only seems to be a subset of events that can be tracked like this, mousemove isn't set up automatically - and unfortunately it's exactly what I need, there is no other substitute.... in this case anyway... thanks.

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
Contributor ,
Sep 19, 2013 Sep 19, 2013

thought i was the only one!

apparently it works for some elements like 'StaticText' but not for others like 'DropDownList' 😕

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
New Here ,
Jul 31, 2013 Jul 31, 2013

Hi there Alan. Good thread.

Things I found:

Custom elements now require type:'customButton', else no onClick is called. Workaround is to to make it Button element or to add .addEventListener('click'...) instead of onClick;

TreeView totaly bugged. If you have onExpand or onCollapse, AE crashes randomly. In versions CS5, CS5.5 and CS6 it crashes only if you have nodes stacked in node element. The more lines of code you provide in the onCollapse or onExpand methods the more often it crashes - crashes after 30-50 clicks of the arrow button with only "$.writeln(node.expanded);" and after 3-4 clicks if you have 5 lines of logical code. Node expanded property always false (this seems to be the case for all AE versions after CS5). Setting it to true should open the node and false should close it as stated in the CS6 Guide, but it does not.

AE crashes after closing script palette. You can't reference ScriptUIBrush - myWindow.graphics.backgroundColor = myOtherWindow.graphics.backgroundColor. Workaround: myWindow.graphics.backgroundColor = myWindow.graphics.newBrush(...., myOtherWindow.graphics.backgroundColor.color ). This crashes AE on Windows and Mac, versions: CS5, CS5.5, CS6 (after closing the palette) and CC (on runtime)

Cheers,

Tony

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
Engaged ,
Jul 31, 2013 Jul 31, 2013

The end of Peter Kahrel's pdf has an CC Script UI changes appendix. It's a bit vague - like our thread! but throws up some other stuff too. BTW Todd Kopriva responded to another thread there and said he would post the nuts and bolts of the changes soon.

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
New Here ,
Sep 10, 2013 Sep 10, 2013

Another thing I noticed about scripted buttons-  You can't color them.  In the past you could make a group or panel the same size as the button, and give it a background color.  Then make the button right on top of that small panel, the same size, and the button would inherit the color.  No more.  )-:  Weeks of my work down the tubes.

Also, somebody mentioned AE crashing when you close a script window.  Strangely I had that in previous versions of AE, but not in CC.  (I'm on Mac.)

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
Advocate ,
Sep 10, 2013 Sep 10, 2013

If you want color you now need images. You'll face other issues.

http://forums.adobe.com/message/5447193#5447193

http://forums.adobe.com/message/5642864#5642864

Xavier

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
Enthusiast ,
Sep 10, 2013 Sep 10, 2013

Also, I came across an issue in CC that was not ocurring in CS6.  In CC, if you register an .onClick event handler on an EditText object, the handler never gets executed.  On CS6 doing the same thing will execute the registered handler.  I also noticed that access to font drawing in CC is unavailable.

I know there has to be a reason for all these changes.  They seem, well, pretty drastic. . .

--Arie

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
Engaged ,
Sep 11, 2013 Sep 11, 2013

A technique I am using now is using groups and setting up an onClick handler, the background colour goes say a different tone for a press. Then the text of the 'button' is just a statictext sitting in the group. So you would sacrifice the built in 3d look of buttons for colour. It's tidy enough without using external images and lengthy code.

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
New Here ,
Sep 11, 2013 Sep 11, 2013

Great idea, Alan.  But I'm having trouble getting any kind of onClick to work for a group or panel.  Do you have any sample code?

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
Engaged ,
Sep 11, 2013 Sep 11, 2013

I will when at desk in the morning, at home now. That is pre- CC by the way - I think I could hazard a guess that it is yet another thing that does not work in CC!!

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
New Here ,
Sep 11, 2013 Sep 11, 2013

Hey Alan, I made it work a different way.  (Still interested in knowing how you did it if it works in CC though.)  This is what I did to make it work without an onClick on the group:

I made a group with a background color, then made static text on top of that group, just as you suggested.  But then I simply made a button on top of the group, and added this:

myButton.onDraw = function(){

// Do nothing.  Don't draw the button.

}

Even though the button isn't drawn, I can still put my onClick on that button.

(Also, note that the static text needs a "justify = 'center'" to center your text, which the button would have done automatically.)

You know, in the end, I actually like how this looks better than the 3D buttons.  It's a much more "flat" interface look, which we know is all the rage with the kids these days.

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
Advocate ,
Sep 11, 2013 Sep 11, 2013

Smart.

This makes pretty much everything accept click events.

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
Engaged ,
Sep 12, 2013 Sep 12, 2013

function buttonTest(txt){

   

            var win = new Window ("dialog","test",undefined);

            win.graphics.foregroundColor= win.graphics.newPen(win.graphics.PenType.SOLID_COLOR, [.7, .7, .7], 1);  

            win.graphics.backgroundColor= win.graphics.newBrush(win.graphics.BrushType.SOLID_COLOR, [.2, .2, .2], 1);  

           

   

           

            //add group

             var b = win.add("group");

             b.graphics.backgroundColor= b.graphics.newBrush(b.graphics.BrushType.SOLID_COLOR, [.5, .5, .7], 1);   

             b.addEventListener ("click", function (m){handleMouseDown(m,b)});

            

             //overlay text

            var bText= b.add('statictext',undefined,txt);

            bText.enabled=false;

            bText.preferredSize.width=300;

           

           

           

            var buttonClose = win.add("button",undefined,"Close");  buttonClose.preferredSize= [130,20];

            buttonClose.onClick = function (){ this.parent.close();}//close the window.

           

           // bText.onClick=function(){

            //On click works in the ESTK on a group not in AFX - so using an event listener.

               

              //  this.parent.graphics.backgroundColor= this.parent.graphics.newBrush(this.parent.graphics.BrushType.SOLID_COLOR, [.1, .1, .8], 1);

              //  $.sleep(300);

              //  this.parent.graphics.backgroundColor= this.parent.graphics.newBrush(this.parent.graphics.BrushType.SOLID_COLOR, [.5, .5, .7], 1);

               

               // }

            //On click-------------------------------

            function handleMouseDown(ev,theButton){

               

              

                theButton.graphics.backgroundColor = theButton.graphics.newBrush(theButton.graphics.BrushType.SOLID_COLOR, [.9, .1, .1], 1);

             

                }

            //On click-------------------------------

           

            //------------------------------

           

            win.show();

}//close

buttonTest('Go on Click me...');

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
Engaged ,
Sep 12, 2013 Sep 12, 2013

In reference to the above...

So the ESTK works fine with onClick but not in After Effects. -Using an event listener, so you could set up mouseover listeners etc also... and mouseout (or whatever they are called.)

Brilliant idea to not draw the button...! 

Here I have disabled the edittext so the mouse pointer doesn't change into a cursor when hovering over the text...

So all this is not working in CC because of event listeners and changes in the scripting. . .  so again, this is all pre-CC stuff.

The guys over on inDesign have a few more threads on custom buttons and physically drawing them based on length of strings etc. There is a link in the back of Peter Kahrel's pdf.

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
New Here ,
Sep 12, 2013 Sep 12, 2013

Thanks for the code specifics Alan.  Bummer that it's pre-CC!

A thought that I haven't tried yet- I wonder if you could just get the mouseOver from the invisible button and make a function that changes the background color of the group.

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
Engaged ,
Sep 12, 2013 Sep 12, 2013

Well I think that you would have to do an event listener for that anyway, so it would be the same deal.

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
New Here ,
Sep 12, 2013 Sep 12, 2013

I can confirm that in CC you can still addEventListener's to buttons.  Even if the button is invisible with the onDraw trick. 

So I'd guess that if you hooked up a mouse over listener to a function that changed the background color of the group, then you could change the color of your virtual button during a user's mouse over.

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
Explorer ,
Sep 15, 2013 Sep 15, 2013

I made a group with a background color, then made static text on top of that group, just as you suggested.  But then I simply made a button on top of the group, and added this:

myButton.onDraw = function(){

// Do nothing.  Don't draw the button.

}

This is a really cool idea, can I ask how you stack control objects on top of each other to make this work?

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