Quantcast
Channel: Adobe Community : Discussion List - After Effects Scripting
Viewing all 2143 articles
Browse latest View live

Comparing two Arrays and generating a new Array.?????????

$
0
0

Hi guys

can some one solve this problem. plz...

 

Say i have two arrays, one is String Array and other is selectedLayers array with same source names(a,b,c) selected in after effects.

Now i want to generate new Array using String in mySelectedComps[].source.name.

 

For example

 

var callName=["a","b"];

var mySelectedComps=app.project.activeItems.selectedLayers; //(eg.i have selected a,b,c comps in afx)

var newArray=[];


 

if(callName[]==mySelectedComps[].source.name){

newArray.push();

 

}

 

how to interate both arrays at same time or how to Compare an element in an Array1 with all elements in  Array2 until it returns true/false.and then go to next element in Array1. ??


Java onShortcut command not working

$
0
0

Can someone help me with onShortcut thing?

I have OnClick function for the below, but onShortcut alt+R not working, any help would be appreciated.

 

myPanel.timeSavers.MyTools_tab.nullButton.shortcutKey='R';

myPanel.timeSavers.MyTools_tab.nullButton.onShortcutKey=myPanel.timeSavers.MyTools_tab.nul lButton.onClick;

myPanel.timeSavers.MyTools_tab.defaultElement=myPanel.timeSavers.MyTools_tab.nullButton;

 

 

Thanks

How to change size and color of "staticText"??

$
0
0

Can someone plz share how to change size and color of "staticText" object??

 

 

 

function buildUI(thisObj) {

 

var myPanel = (thisObj instanceof Panel) ? thisObj:new Window('palette', 'Stress Reducers',undefined, {resizable: true});

 

var txt=myPanel.add("staticText",[0,0,100,20],"txt");

 

//txt. newFont, fontSize,color?????

 

 

  return myPanel;

 

}

 

 

var myToolsPanel = buildUI(this);

Tabbed Panel Issues with CS5,CC2014,CC2015?

$
0
0

I have created a script with TabbedPanel in ESTK CC,works fine in afx CC 2014, but it seems like there are some issues with other versions(CS5 and CC2015).

Can someone help how to universalize the tabs and bounds???

Below is my Code briefly for tabs.

//

//

//

function buildUI(thisObj) {

 

var myPanel = (thisObj instanceof Panel) ? thisObj:new Window('palette', 'Stress Reducers',undefined, {resizable: true});

 

myPanel.timeSavers= myPanel.add("tabbedpanel", [0,0,400,300], 'Stress Reducers V1');

myPanel.timeSavers.cProject_tab= myPanel.timeSavers.add("tab", undefined, "Project");

myPanel.timeSavers.MyTools_tab= myPanel.timeSavers.add("tab", undefined, "MyTools");

myPanel.timeSavers.Explorer= myPanel.timeSavers.add("tab", undefined, "Explorer");

myPanel.timeSavers.Others_tab= myPanel.timeSavers.add("tab", undefined, "Install");

 

return myPanel;

 

}

var myToolsPanel = buildUI(this);

//

//

//

Below are the results starting from left CS5,CC2014,CC2015.How to universalize buttons,tabs, alignments etc like in CC2014 in other versions.Some one Plz help??

afx cs5.pngafx cc 2014.pngafx cc 2015.png

onChange Tabbed Panel, got an error in my Window Panel.

$
0
0

I have a problem with my window panel, when i close the panel in after effects i got this error NULL IS NOT AN OBJECT in this line: switch(selectedTab.selection.text) how can i resolve that?

 

The thing is that i have this cases to call my TabbedPanel with the different tab names, but when i close all the window panel i got that error.

 

 

// FUNCIONES EL TABBED PANEL
myPanel.grp.myTabbedPanel.onChange = function(){    var selectedTab = myPanel.grp.myTabbedPanel;    switch(selectedTab.selection.text){          case "Salidas":     //If Salidas was clicked...                                   myPanel.grp.myTabbedPanel.myTab1.ddPanel.selection = 0                             break;          case "Plecas":     //If Plecas was clicked...                     myPanel.grp.myTabbedPanel.myTab1.ddPanel.selection = 0                                 break;          //and so on for the other tabs you have.          default:          break;    }
}

I want to write a script that alerts me the RGBA values on mouse click

$
0
0

I'm essentially wanting to be able to capture the RGBA values under the mouse cursor when a user clicks an object on the canvas (I will be storing these for later use) . Just as you see these values in the info panel changing as you move your mouse around the canvas, I want to create an alert showing the current RGBA values when a user clicks on any pixel on the canvas. Any help would be greatly appreciated.

 

Casey

Unit Testing a la mocha/karma/chai for Extend Script?

$
0
0

We are writing unit tests with mocha, karma, chai, sinon, and bamboo for our angular that we use in our Adobe extension, but the main material that we need to be tests all lives in our Extend Script files. Has anyone had experience using any testing libraries with Extend Script?

Call jsx from the same folder in script without extended path

$
0
0

Hi, i actually got this code:

 

var tabPlecaName = "PlecaTest.jsx";

var tabPlecaPath = $.evalFile + File($.fileName).path + "/" + escape(tabPlecaName);

 

But the thing is that i cant call my File from the Script UI folder without the extended path like ~/Desktop/Applications/After Effects xxx/blablablabla

 

I want to call that file from the same folder of my installed Script UI.


How to put a scroll inside my tabs content?

$
0
0

Here is my code:

 

{    function myScript(thisObj){        function myScript_buildUI(thisObj){            var myPanel = (thisObj instanceof Panel) ? thisObj : new Window("palette","Panel Estudio Voraz",undefined,{resizable:true});            myPanel.layout.resize();

res = "group{orientation:'column',margins: 0, spacing: 0,\
                      alignment: ['fill', 'fill'], alignChildren: ['fill', 'top'],\                          myTabbedPanel: Panel{type:'tabbedpanel',\                                myTab1: Panel{type:'tab', text:'Salidas',margins: [4,8,4,8], spacing: 5, alignChildren: ['fill', 'center'],\                                 },\               myTab2: Panel{type:'tab', text:'Plecas',\                  imageWIP: IconButton{text:'WIP',alignment:['top','top'], preferredSize:[372,180]},\               },\               myTab3: Panel{type:'tab', text:'Stings',\                  imageWIP: IconButton{text:'WIP',alignment:['top','top'], preferredSize:[372,180]},\               },\               myTab4: Panel{type:'tab', text:'Menus',\                  imageWIP: IconButton{text:'WIP',alignment:['top','top'], preferredSize:[372,180]},\               },\               myTab5: Panel{type:'tab', text:'Wipers',\                 imageWIP: IconButton{text:'WIP',alignment:['top','top'], preferredSize:[380,180]},\               },\           },\
}";              myPanel.grp = myPanel.add(res);            myPanel.grp.spacing= 0



 myPanel.grp.myTabbedPanel.onChange = function(){     var selectedTab = this.selection;     alert(selectedTab.text);    //Alerts the name of the tab that was clicked     alert(selectedTab.reflect.properties);//Alerts the property options available for your tab object     switch(selectedTab.selection.text){          case "Salidas":     //If Salidas was clicked...                                   myPanel.grp.myTabbedPanel.myTab1.ddPanel.selection = 0                             break;          case "Plecas":     //If Plecas was clicked...                     myPanel.grp.myTabbedPanel.myTab1.ddPanel.selection = 0                                 break;          //and so on for the other tabs you have.          default:          break;              }
} 



//END PANEL    --------------------------- NO PONER NADA ABAJO DE ESTA LÍNEA -------------------------------            return myPanel;              }                  var myScriptPal = myScript_buildUI(thisObj);              if((myScriptPal != null) && (myScriptPal instanceof Window)){            myScriptPal.center();            myScriptPal.show();    }


}
myScript(this);
}

writeXml in PresetEffects.xml of After Effects

$
0
0

Hi, i want to make a script to add lines in the PresetEffects.xml file inside After Effects/Content/Resources detecting if is Windows use C:/Programs/etc.... or if is MacOs   Applications/etc...  

 

and add this lines at the end but before the last line </Effects>:

 

<Effect matchname="OpenTag1" name="$$$/AE/Preset/OpenTag1=OpenTag1">

  <Popup name="$$$/AE/Preset/Txt=Txt" popup_string="$$$/AE/Preset/Txt/Popup=Texto libre|-|Hoy|Manana|-|Este lunes|Este martes|Este miercoles|Este jueves|Este viernes|Este sabado|Este domingo|-|Esta tarde|Esta noche" default="1"/>

  <Popup name="$$$/AE/Preset/ColorSystem=Color System" popup_string="$$$/AE/Preset/ColorSystem/Popup=Amarillo|Morado|Light Blue|Mid Blue|Dark Blue|Rojo" default="1"/>

  <Popup name="$$$/AE/Preset/Ctn=Ctn" popup_string="$$$/AE/Preset/Ctn/Popup=Short|Mid|Long" default="1"/>

</Effect>

editText.active doesn't work

$
0
0

Hi

 

I have a editText and I would like to check if it is in focus. I do it like this:

 

if(textfield.active)

{

     //Do something

}

 

This doesn't work. It always returns false. Is there any other way to check if a textfield is currently in focus? With focus I mean, the textfield is marked with the cursor and user can input text into it.

 

While playing around with it I also noticed that this works:

 

textfield.active = true;

 

While this do not:

 

textfield.active = false;

 

... wierd.

 

 

- Jakob

Top/Left Value of Point Text Relative to Composition?

$
0
0

So since the width and height of a point text layer is

 

--always the size of the composition

--calculateTransformFromPoints can only set and not read a set of values

-- a point text layer's sourceRectatTime top and left values (as well as baselineLoc values)  are relative, as far as I can tell, to its... anchor point? And

-- I can't rely on its anchor point since a) end users move the anchor point and b) we have other functions that periodically center the anchor point of every layer,

 

I was wondering if there were some other way to calculate the top and left values of a point text layer relative to the composition?

 

Do I have to draw a mask that is the full size of the layer and then derive the values from its vertices?

After Effects Error

$
0
0

After trying to use bridge with After Effects I keep getting this error message

app.project.activeltem.selectedlayers[aLayer].applyPreset is undefined

What does this mean?

How to $.eval.File("File Path From Internet.jsx") path from Internet?

$
0
0

I want to call my JSX file path from internet, i actually uploaded my JSX to Dropbox so i want to evalFile from there.

 

Thank you in advance.

addEventListener for check box

$
0
0

Hi

 

I have a check box. I would like to set up an eventListener for it.

 

This works:

 

cb.onClick = function()

{

     alert("clicked");

}

 

This don't:

 

cb.addEventListener("click", cbClick);

function cbClick()

{

     alert("clicked");

}

 

 

Why not? I have used the addEventListener method for many other components.

 

Thanks,

Jakob


resize an image to the icon button size

$
0
0

hi,

how can i resize an image to the icon button size?

 

var w = new Window ("dialog");

b=w.add ("iconbutton", undefined, "~/Desktop/abc.png");

b.size=[50,50]

w.show();

multiple onClick

$
0
0

hi,

 

What should I do in order to make all onClick buttens to do index button alert?

 

 

 

var myWin = buildUI(this);

if (myWin != null && myWin instanceof Window) {

  myWin.show();

  }

 

 

function buildUI (thisObject) {

 

 

if (thisObject instanceof Panel) {

  var myWin = thisObject;

  } else {

    var myWin = new Window ("palette", undefined, [200, 200, 600, 500], {resizeable: true});

  }

 

 

if (myWin != null ) {

 

 

 

        btnGroup=myWin.add("group");

        btnGroup.orientation="column"

       

       

       

        var AIBtns=[];

        var filse=4;

        var r=0;

        for(r;r<filse;r++){

            AIBtns[r]= btnGroup.add("button", undefined,name=[r+1] ,{style:"toolbutton"});

            AIBtns[r].onClick=function (AIBtns){

              alert(r)//<<

                }

           

            }

//~         alert(AIBtns)

 

 

  myWin.layout.layout(true);

  myWin.layout.resize();

   

  myWin.onResizing = myWin.onRize = function () {

        this.layout.resize();}

  } //if (myWin != null )

return myWin;

} //function buildUI (thisObject)

$.evalFile(.jsx from FTP)

$
0
0

Hi, thank you in advance, i want to call a File from FTP server so i have to do $.evalFile(And here is the FTP Path from server). How can i do that???

[Tutorial] After Effects ExtendScript Script Writing

$
0
0

Hi all, just wanted to share a new tutorial series I have launched today that I think a lot of you may find helpful.

 

We've all posted here in this forum looking for help with scripting. There are many reasons why too. One of which that keeps making the rounds is the lack of documentation for ExtendScript. When I first started scripting for After Effects five years ago, the CS3 guide is all there was and it did contain the proper information, but as a newbie I was unable to understand the guide to get any real help from it. I didn't know Javascript then and I was super frustrated. Asking questions and searching forums like this was my only option really. No real training existed, that I'm aware of, that truly covered how to use ExtendScript. That is, until now. I have spent the better part of my weekends over the past year recording this training series to give the After Effects community a decent collection of information in one place to help get people started in scripting. This series comes in at over ten hours in length and is being released in segments on a weekly basis as of today. There is a lot to cover in ExtendScript and I do cover much of it. I'm unable to hit 100% of it as I too am still learning some of the more advanced aspects of it. I do cover however the basics of Javascript, looping through project items, creating folders, creating comps, creating layers, reading various project information, building GUI's, creating/reading txt documents, etc...

 

If you are a newbie looking to learn ExtendScript, a frustrated artist who's confused by programming, a script developer looking for more info, then at one point or another I believe this series will help you.

 

The first three episodes begin here:

http://provideocoalition.com/news/video/after-effects-extendscript-training-ep-1-2-3

 

Keep an eye out for more posts each week. thanks, and I hope you find this resource useful.

 

-David Torno

Looking for a creative way to find XY mouse position via expression or scripting

$
0
0

I'm looking for a way to get the mouse position on the comp as it already reads from the info panel and use it for an expression or script. Any ideas?

Viewing all 2143 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>