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

Completely Independent Duplicates?

$
0
0

Hello I'm back,

 

First off thank you for your replies on my last post.

 

Here is what I am trying to accomplish:

 

     I have six compositions. The first composition contains three text layers, and the second composition contains two text layers. The remaining four compositions automatically change when the text is changed in the first two compositions, and do not have their own layers. My script reads a .txt file, stores the info into an array, and then populates the first two composition's text layers. After each iteration of filling those text layers, it renames the composition and duplicates it.

 

Here's the problem:

 

     All of the duplicates from the first two compositions are exactly what I need. Their text layers each have different text, and the composition is named correctly. The other duplicates from the other four compositions come out differently. The composition names are correct, but the value of the text layers are all filled with the last strings that were passed to the original two compositions. Is there anyway to make my duplicates completely independent so they don't respond to the first two comps ?

 

 

Thank you in advance!

 

Garrett


Script - Pro import AAF

$
0
0

Hello

 

I'm trying to create a script to automatically import a folder containing a. AAF.

I can't find the code to enable the Pro Import and not the classic.

Have you any idea of a script to import several AAF auto at the same time?

 

Thank you

 

Mr.J

How to remove an item object (created by a script) from project?

$
0
0

For example:

 

TempNull = app.project.activeItem.layers.addNull();

.

.

.

Use it somehaw

.

.

.

TempNull.remove();

 

it will remove object from comp

but how to remove it from project also (newly created Null item in "Solids" folder)

I want to keep the project structure the same as before script execution.

aerender and EXR

$
0
0

Hello,

 

I am attempting to render .exr files via the command line using aerender -output /myPath/myFile.[#####].exr .

 

Unfortunately it keeps on rendering .movs.

 

Is there any way to specify the format in the command line arguments?

 

If the -OMtemplate is the only way. Is there a way to explicitly define a path to a saved template? I have many machines and would prefer keeping the template on 1 drive visible to all computers on my network.

 

Thank you,

Chris

Bug on a dockable GUI

$
0
0

Hi everyone,

 

I just created a dockable GUI for my designers.

 

It works perfectly well on my own computer, but on the others, when I run the script (with Run script... ou Window/myScript.jsx) I have this error : "unable to execute script at line 35. Bad argument - File or Folder does not exist."

 

my line 35 is : myPanel.grp = myPanel.add(res);

 

We have the same version of after effects, the same settings on Preferences/General... and the same computers. So, I really don't understand what it happens, why it works on my computer an not on the 4 others...

 

Here is my menu

 

{

function myScript(thisObj) {

     function myScript_buildUI(thisObj) {

          var myPanel = (thisObj instanceof Panel) ? thisObj : new Window("palette", "Menu Pitchy", undefined, {resizeable:true});

          res="group{orientation:'column',\

               myPanel1: Panel{text:'Mises à jour', orientation:'row',\

                    myButton01: IconButton{text:'Mise à jour complète', tooltipActive:'Mise à jour complète', image:'D:/PITCHY/Scripts/Images/All.png'},\

                    myButton02: IconButton{text:'Vidéo', image:'D:/PITCHY/Scripts/Images/Video.png'},\

                    myButton03: IconButton{text:'Lignes Text', image:'D:/PITCHY/Scripts/Images/Lignes.png'},\

                    myButton04: IconButton{text:'Info Séquence', image:'D:/PITCHY/Scripts/Images/Info.png'},\

               },\

               myPanel2: Panel{text:'Débug', orientation:'row',\

                    myButton05: IconButton{text:'Layer Style', image:'D:/PITCHY/Scripts/Images/Layer.png'},\

                    myButton06: IconButton{text:'Disable Null', image:'D:/PITCHY/Scripts/Images/Null.png'},\

                    myButton07: IconButton{text:'Code Camembert', image:'D:/PITCHY/Scripts/Images/Codecam.png'},\

                    myButton08: IconButton{text:'Code Position line1', image:'D:/PITCHY/Scripts/Images/Posline.png'},\

               },\

               myPanel3: Panel{text:'Réglages', orientation:'row',\

                    myButton09: IconButton{text:'Rescale Bloc', image:'D:/PITCHY/Scripts/Images/Rbloc.png'},\

                    myButton10: IconButton{text:'Rescale Ligne', image:'D:/PITCHY/Scripts/Images/Rligne.png'},\

                    myButton11: IconButton{text:'Polices', image:'D:/PITCHY/Scripts/Images/Polices.png'},\

               },\

               myPanel4: Panel{text:'Tests', orientation:'row',\

                    myButton12: IconButton{text:'Text 40 car.', image:'D:/PITCHY/Scripts/Images/T40.png'},\

                    myButton13: IconButton{text:'Text 120 car.', image:'D:/PITCHY/Scripts/Images/T120.png'},\

                    myButton14: IconButton{text:'Time Stretch', image:'D:/PITCHY/Scripts/Images/Time.png'},\

               },\

          }";

 

          myPanel.grp = myPanel.add(res);

         

          /*---- My buttons settings ----*/

          return myPanel; }

    

     var myScriptPal = myScript_buildUI(thisObj);

    

     if(myScriptPal != null && myScriptPal instanceof Window)

     { myScriptPal.center(); myScriptPal.show(); }

}

 

myScript(this);

}

Dynamically add and remove ScriptUI elements

$
0
0

Hello. I'm looking for a way to add and remove elements like groups on click.

The idea is to generate them instead of toggling .visible option on and off.

 

Though after searching through manuals I'm still unsure how to do this.

Extendscript Multiline Button

$
0
0

Is there a way to make the text on a button multiline?

 

I tried

var Button = w.add('button',undefined,"Input\r Sonderfarbe");

which only resulted in a shorter button but with no linebreak.

Progress Bars On AE CC15

$
0
0

Hi there,

 

 

I'm creating a script that duplicates a folder and all of its items and goes through each comp and replaces its layers, fixes expressions etc... I'm quite a beginner and have been doing quite well till yesterday, creating the progress bar for my script is where I'm stuck. My script's UI is dock-able and it has a button that triggers the script and creates a palette window where the progress bar is shown on. Inside the for loops that takes most of the time that the script needs (the script takes 2-3 minutes for the project I'm testing the script on), I increase both of the maxvalue and the value of the progress bar. So far nothing wrong, but in AE CC15 (my OS is Windows 10) the palette window crashes (I mean by that it shows "(Not Responding)" on the palette window's title bar) after a few seconds thus the progress bar doesn't update itself anymore. When the script finishes the operation, the progress bar goes to its max value right away. I tested the script on AE CS5.5 and that doesn't happen.

 

Why does the palette window crash? Is this a bug in CC15?

 

I don't want to share all of my code here, I don't want my script's source code to be online, so here is something I can share:

{  function TrueFoldersDuplicatorScript (thisObj) {  function CreateProgressBar () { // This function creates the progress bar's palette window  var w = new Window("palette", "Progress", undefined);  var res = "group{orientation:'column', alignment:['fill','fill'],\  Grp: Group{orientation:'row', alignment:['fill','fill'],\  pb: Progressbar{text: 'Progressbar', alignment:['fill','fill']},\  percenText: StaticText{text: '', alignment:['center','center']},\  },\  pbText: StaticText{text: '', alignment:['fill','fill']},\  okb: Button{text: 'Ok'},\  }";  w.grp = w.add(res);  w.grp.Grp.pb.maxvalue = 0;  w.grp.Grp.pb.minimumSize = [250, 10];  w.grp.Grp.pb.value = 0;  w.grp.pbText.text = "Please wait...";  w.grp.Grp.percenText.text = "00.00%";  w.grp.okb.enabled = false;  w.grp.okb.onClick = function () {this.window.close()}  w.center();  w.show();  return {  theText: function(STR){w.grp.pbText.text = STR; w.update()},  thePercnText: function(str){w.grp.Grp.percenText.text = str; w.update()},  w:w,  SetMax: function(max){w.grp.Grp.pb.maxvalue += max; w.update()}, //Resets the max value  Increment: function(){w.grp.Grp.pb.value += 1; w.update()}, //Increases the value  Finished: function(){w.grp.okb.enabled = true;},  pbValue: function(){return w.grp.Grp.pb.value},  pbMaxValue: function(){return w.grp.Grp.pb.maxvalue},  }  }  function ButtonOnClickDuplicateFunction (panel) {  var SelectedItems = app.project.selection;  if (SelectedItems.length === 1 && SelectedItems[0] instanceof FolderItem) {  var PB = CreateProgressBar (); // Calling the function that creates the palette window  var SelectedItems = app.project.selection;  for (var c = 0; c < SelectedItems.length; c++) {  if (SelectedItems[c] instanceof FolderItem) {  var newFolder = DuplicateFolder(SelectedItems[c], PB); //Duplicates the original folder and its content  var copyFolderItems = allItemsInFolder(newFolder); //Every comp, solid, footage in the new folder  var origFolderItems = allItemsInFolder(SelectedItems[c]); ////Every comp, solid, footage in the original folder  PB.SetMax(copyFolderItems.length); //Increases the max value  PB.thePercnText((Math.round((PB.pbValue() / PB.pbMaxValue()) * 10000) / 100).toString() + "%");  for (var k = 0; k < copyFolderItems.length; k++) {  if (copyFolderItems[k] instanceof CompItem) {  PB.SetMax(copyFolderItems[k].numLayers);  PB.thePercnText((Math.round((PB.pbValue() / PB.pbMaxValue()) * 10000) / 100).toString() + "%");  for (var j = 1; j <= copyFolderItems[k].numLayers; j++) {  //Replaces each comp's layers in the new folder using layer.replaceSource()  PB.Increment(); //Increases the value  PB.thePercnText(((Math.round((PB.pbValue() / PB.pbMaxValue()) * 10000) / 100).toString() + "%"));  }  }  PB.Increment();  PB.thePercnText(((Math.round((PB.pbValue() / PB.pbMaxValue()) * 10000) / 100).toString() + "%"));  }  PB.SetMax(copyFolderItems.length);  PB.thePercnText((Math.round((PB.pbValue() / PB.pbMaxValue()) * 10000) / 100).toString() + "%");  for (var g = 0; g < copyFolderItems.length; g++) { //Fixes all the expressions in the new folder  if (copyFolderItems[g] instanceof CompItem) {  for (var t = 1; t <= copyFolderItems[g].numLayers; t++) {  fixExpressions(copyFolderItems[g].layer(t), copyFolderItems, origFolderItems);  }  }  PB.Increment();  PB.thePercnText(((Math.round((PB.pbValue() / PB.pbMaxValue()) * 10000) / 100).toString() + "%"));  }  }  }  PB.Finished();  PB.thePercnText((Math.round((PB.pbValue() / PB.pbMaxValue()) * 10000) / 100).toString() + "%");  PB.theText("All Done!");  }  function DuplicateFolder(Folder, PrB) {  var newFolder = app.project.items.addFolder(Folder.name);  PrB.SetMax(Folder.numItems);  for (var b = 1; b <= Folder.numItems; b++) {  //Duplicates every item in a folder  PrB.Increment();  }  return newFolder;  }  function allItemsInFolder(aFolder) {  var Items = new Array();  //returns an array with everything in a folder  }  function fixExpressions (aProp, copyFolderItems, origFolderItems) {  //Fixes expressions  }  }  function numCopiesTextChange() {  numCopiesTextValue = this.text;  }  function TrueFolderDuplicatorScript_buildUI(thisObj) { //The dock-able UI of the script  var panel = (thisObj instanceof Panel) ? thisObj : new Window("palette", "Window Name", undefined, {resizeable:true});  var res = "group{orientation:'column', alignment:['left','top'],\  mainPanel: Panel {orientation:'column', alignment:['fill','fill'],\  FirstGroup: Group{orientation:'row', alignment:['fill','bottom'],\  numCopies: EditText{text: '1', alignment:['left','fill']},\  numCopiesText: StaticText{text: 'Copies', alignment:['left','center']},\  },\  SecGroup: Group{orientation:'row', alignment:['fill','bottom'],\  solidsCheckBox: Checkbox{text: 'Duplicate Solids', value: true, alignment:['left','fill']},\  footageCheckBox: Checkbox{text: 'Duplicate Footage', value: false, alignment:['left','fill']},\  },\  replaceButton: Button{text: 'Duplicate!', alignment:['center','bottom']},\  },\  }";  panel.grp = panel.add(res);  panel.grp.mainPanel.FirstGroup.numCopies.minimumSize = [23,15];  panel.layout.layout(true);  panel.grp.minimumSize = panel.grp.size;  panel.layout.resize();  panel.onResizing = panel.onResize = function () {this.layout.resize();}  solidsCheckBoxValue = true;  footageCheckBoxValue = false;  panel.grp.mainPanel.SecGroup.solidsCheckBox.onClick = function () {solidsCheckBoxValue = panel.grp.mainPanel.SecGroup.solidsCheckBox.value};  panel.grp.mainPanel.SecGroup.footageCheckBox.onClick = function () {footageCheckBoxValue = panel.grp.mainPanel.SecGroup.footageCheckBox.value};  panel.grp.mainPanel.FirstGroup.numCopies.onChange = panel.grp.mainPanel.FirstGroup.numCopies.onChanging = numCopiesTextChange;  panel.grp.mainPanel.replaceButton.onClick = function () {  app.beginUndoGroup("Duplicate Folder");  ButtonOnClickDuplicateFunction(panel);  app.endUndoGroup();  }  return panel;  }  var TrueFolderDuplicatorScriptPal = TrueFolderDuplicatorScript_buildUI(thisObj);  if(TrueFolderDuplicatorScriptPal != null && TrueFolderDuplicatorScriptPal instanceof Window) {  TrueFolderDuplicatorScriptPal.center();  TrueFolderDuplicatorScriptPal.show();  }  }  TrueFoldersDuplicatorScript(this);

}

Thanks!

 

Message was edited by: Osama Sa


move playhead with script

$
0
0

is it possible to move the playhead via scripting ?  I can find no way to do it and it's driving me nuts.

 

I have a job that requires a huge amount of commented markers on multiple layers so I've built a small scriptUI panel with keyboard shortcuts for all the markers i need to place but the problem is I have to keep switching focus from the scriptUI panel to move the damn playhead, if I could do it all from within my panel it would speed things up by several orders of magnitude!

 

any suggestions greatly appreciated.

 

JL

How to ignore all script error in my .jsx

$
0
0

Hi,  I actually have an specific jsx that only works with an specific .aep. So when i run the script without the .aep open, the ExtendScript Toolkit send me to that window, and i want to ignore all errors or skip one error line and send an alert inside after effects. How can i do that? inside my .jsx.

 

My First Panel GUI Structure is the classic one that "David Torno" share online:

(I will not share all the code because is too much code lines)

 

{

    function myScript(thisObj){

        function myScript_buildUI(thisObj){

            var myPanel = (thisObj instanceof Panel) ? thisObj : new Window("palette","Panel Estudio Voraz",[10, 10, 300, 300],undefined,undefined,{resizable:true},{borderless:true});

            myPanel.layout.resize();

           

            res = "group{orientation:'column',margins: 0,spacing: 0,\

                          myTabbedPanel: Panel{type:'tabbedpanel',\

                               myTab1: Panel{type:'tab', text:'OpenTag',\

                               topImgGrp: Panel{type:'panel',text:'',\

 

                            myIconButton: IconButton{text:'IconButton',},\

                      },\

                }";

                   

BLABLABLA   TOO MUCH CODE                       

       

            myPanel.grp = myPanel.add(res);

            myPanel.grp.spacing= 0

            myPanel.minimumSize.width = 400

 

            return myPanel;

       

        }

  

   

      

   

        var myScriptPal = myScript_buildUI(thisObj);

       

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

            myScriptPal.center();

            myScriptPal.show();

    }

 

 

}

myScript(this);

}

Resize edittext in UI

$
0
0

I try to change the length of an edittext depending on a checkbox.

This is my code so far:

 

FormatSingle.z3 = FormatSingle.add('group');
FormatSingle.z3.Titel = FormatSingle.z3.add('edittext',undefined,"Zeile4");
FormatSingle.z3.Titel.characters = 15;
FormatSingle.z3.ifSub = FormatSingle.z3.add('checkbox',undefined,"Unterzeile");
FormatSingle.z3.ifSub.onClick = function()     {          if (this.value == true)          {               FormatSingle.z3.Titel.characters = 23;               w.layout.layout(true);               w.layout.resize(true);          }          else          {               FormatSingle.z3.Titel.characters = 15;               w.layout.layout(true);          }     }

 

('w' is my window, 'FormatSingle' is a defined variable (group))

 

For the layout-commands I tried multiple versions, like this one; without the 'true'; not with the 'w' but with 'FormatSingle', but the only thing happening (if anything happens) is that other Elements of my window move slightly around.

Error: Object Invalid with selectedTabPanel when i close window panel.

$
0
0

I have a problem when i Close my Panel Window in after effects, send me to the ESTK window with an error in case: "OpenTag": Saying that is Object Invalid.

So the script is working to set dropdown menus to the 0 selection, but if some dropdown is in other selection, and close my window panel got that error.

 

I have the next code:

 myPanel.grp.myTabbedPanel.onChange = function(){     var selectedTab = myPanel.grp.myTabbedPanel;    if(!selectedTab || !selectedTab.selection) return;    switch(selectedTab.selection.text){          case "Salidas":     //If Salidas was clicked...                             myPanel.grp.myTabbedPanel.myTab1.layoutGrp.ddLayout.selection = 0                    myPanel.grp.myTabbedPanel.myTab2.layoutGrp.ddLayout.selection = 0                    myPanel.grp.myTabbedPanel.myTab3.layoutGrp.ddLayout.selection = 0                    myPanel.grp.myTabbedPanel.myTab6.layoutGrp.ddLayout.selection = 0              break;          case "Plecas":     //If Plecas was clicked...                     myPanel.grp.myTabbedPanel.myTab1.layoutGrp.ddLayout.selection = 0                     myPanel.grp.myTabbedPanel.myTab3.layoutGrp.ddLayout.selection = 0                     myPanel.grp.myTabbedPanel.myTab6.layoutGrp.ddLayout.selection = 0                     myPanel.grp.myTabbedPanel.myTab4.ddLayout.selection = 0                                 break;                       case "OpenTag":     //If Plecas was clicked...                    myPanel.grp.myTabbedPanel.myTab2.layoutGrp.ddLayout.selection = 0                    myPanel.grp.myTabbedPanel.myTab3.layoutGrp.ddLayout.selection = 0                    myPanel.grp.myTabbedPanel.myTab6.layoutGrp.ddLayout.selection = 0                    myPanel.grp.myTabbedPanel.myTab4.ddLayout.selection = 0                             break;                   case "Cintillo":     //If Plecas was clicked...                    myPanel.grp.myTabbedPanel.myTab1.layoutGrp.ddLayout.selection = 0                    myPanel.grp.myTabbedPanel.myTab2.layoutGrp.ddLayout.selection = 0                    myPanel.grp.myTabbedPanel.myTab6.layoutGrp.ddLayout.selection = 0                    myPanel.grp.myTabbedPanel.myTab4.ddLayout.selection = 0                                                break;                            case "Menu":     //If Plecas was clicked...                    myPanel.grp.myTabbedPanel.myTab1.layoutGrp.ddLayout.selection = 0                    myPanel.grp.myTabbedPanel.myTab2.layoutGrp.ddLayout.selection = 0                    myPanel.grp.myTabbedPanel.myTab3.layoutGrp.ddLayout.selection = 0                    myPanel.grp.myTabbedPanel.myTab4.ddLayout.selection = 0                                                break;          //and so on for the other tabs you have.                   default:          alert("not detected");          break;              }
}

How to change Source Text with EditText in my Script?

$
0
0

Here is my actually code, the thing is that i want to change my text from myEditText in my Panel:

 

function myScript(thisObj) {          function myScript_buildUI(thisObj) {                    var myPanel = (thisObj instanceof Panel) ? thisObj : new Window("palette", "My Panel Name", [0, 0, 300, 300]);                    res="group{orientation:'column', alignment:['fill', 'fill'], alignChildren:['fill', 'fill'],\                              myEditText: EditText{text:'EditText text'},\                              myButton: Button{text:'Button Name'},\                    }"                    //Add resource string to panel                    myPanel.grp = myPanel.add(res);                                                          var texto = myPanel.grp.myEditText.text.value                                       var btn =  myPanel.grp.myButton                                                                             btn.onClick = function (){                                               app.project.item(2113).layer("TXT 1").property("Text").property("Source Text").setValue = texto                                               }                                                                                                //Setup panel sizing and make panel resizable                    myPanel.layout.layout(true);                    myPanel.grp.minimumSize = myPanel.grp.size;                    myPanel.layout.resize();                    myPanel.onResizing = myPanel.onResize = function () {this.layout.resize();}                    return myPanel;          }          var myScriptPal = myScript_buildUI(thisObj);          if ((myScriptPal != null) && (myScriptPal instanceof Window)) {                    myScriptPal.center();                    myScriptPal.show();                    }          }          myScript(this);

Why Socket.open() always return false?

$
0
0

I'm trying to run simple example from "Javascript tools guide" :

reply = "";
conn = new Socket;
// access Adobe’s home page
if (conn.open ("www.adobe.com:80")) {
// send a HTTP GET request
conn.write ("GET /index.html HTTP/1.0\n\n");
// and read the server’s reply
reply = conn.read(999999);
conn.close();
}

$.writeln(reply);


What i need to success connection? I'm tried to open socket with different url, port, encoding types . Always i got false in conn.open(). Please tell me how to create one simple request using Socket object. For example, script what get weather from openweathermap site using simple api(request with city name(q) and api key(appid)). Like this example url:

http://api.openweathermap.org/data/2.5/weather?q=London,uk&appid=2de143494c0b295cca9337e1e 96b00e0

Or any other example.

Thanks!

KeyframeEase object

$
0
0

Hi.

I am trying to work with KeyframeEase object. `var easeIn = new KeyframeEase(Speed, Influence)`. If I set `Influence` to 0.01, AE complaints that it’s out of range `0.1 - 100`. BUT how come I can manually enter 0.01 value to particular keyframe in timeline via RightMouseClisk on keyframe -> Keyframe Velocity -> Influence. I don't get it. Any one can explain this?


why I cannot set `Influence` value to 0.01 via scripting?


Screen Shot 2016-03-19 at 20.59.34.png


Can't get the color psd-layers with scripts and the method sampleimage(). Maybe there are other ways to do it?

$
0
0

Apsd with layermasks, there are nocolorproperties, butthe layer itselfhas a color.How to get the valueof this color? I have tried theapp.project.laeyer(n).sampleImage([i,j],[a,b],false,0);Butwhen you run the scriptthis commandis undefined .Please help!

Program versioncc 2014, OS- Windows 7

 

GUI - Listbox dynamically sorting ?

$
0
0

Hi

i'm doing my first steps into the scripting world, following David Torno's course (great course BTW, thanks a lot!!!)

and i'm trying to put what i've learned into a script that will have "a better render queue", meaning you can see quickly all of your renders, their outputs, when they were rendered, etc.. (the next step will be to export the into excel or something like that..), i'm using Listbox to show all the items, and I was wondering if there's a way to sort the list by different columns headers dynamically (e.g. render path output, date rendered, etc..).

i'd be happy for any help or direction because i couldn't find anywhere online or written info on this (sort listbox) matter.

thanks

D

 

here's what i got so far:

 

try{       var proj = app.project;    var totalRenderQ = proj.renderQueue.numItems;    var rqList = new Array();    var totalOM;       var FSWindow = new Window("palette","Listbox Scroll Bug", undefined,{resizeable:true});            FSWindow.alignment = ["fill","fill"];            FSWindow.alignChildren=["fill", "fill"];    var FSGrp =  FSWindow.add("group", undefined, "groupList");             FSGrp.orientation = "column";            FSGrp.alignChildren = ["fill","fill"];    var quitBtn = FSGrp.add ("button", undefined, "Close");            quitBtn.onClick = function() {                                                            FSWindow.close();                                                            }      var FSList = FSGrp.add("listbox", [0,0,1200,800], "FS List", {multiselect:true,  numberOfColumns: 5, showHeaders: true, columnTitles: ["Render #","Date","Time", "Comp Name", "Render Path"]});    for (var i= 1; i<=totalRenderQ;  i++){            totalOM= proj.renderQueue.item(i).numOutputModules;                    for (var om= 1; om<=totalOM; om++){                                rqList[rqList.length] = "Render #" + i + " - " + om  +": " + proj.renderQueue.item(i).outputModule(om).file.toString();                                var dateList, timeList, curItem;                                if (proj.renderQueue.item(i).startTime != null){                                            var min = proj.renderQueue.item(i).startTime.getMinutes() <10 ? "0"+ proj.renderQueue.item(i).startTime.getMinutes() : proj.renderQueue.item(i).startTime.getMinutes();                                            var year = proj.renderQueue.item(i).startTime.getFullYear().toString().substr (-2,2);                                            timeList = (proj.renderQueue.item(i).startTime.getHours()-1)+":" + min;                                            dateList =proj.renderQueue.item(i).startTime.getDate()+"/"+(proj.renderQueue.item(i).startTime.getMonth()+1)+"/"+year ;                                }else{                                             dateList = "not rendered";                                        timeList = "    ";                                    }                                curItem = FSList.add ('item', "Render #" + i + " - " + om );    // Column 1                                curItem.subItems[0].text = dateList.toString();                         // Column 2                                curItem.subItems[1].text = timeList.toString();                          // Column 3                                curItem.subItems[2].text = proj.renderQueue.item(i).comp.name; // Column 4                                curItem.subItems[3].text = proj.renderQueue.item(i).outputModule(om).file.toString().replace(new RegExp(",","g"), "\r").replace(new RegExp("%20","g"), " ").replace(new RegExp("%5B","g"), "[").replace(new RegExp("%5D","g"), "]"); // Column 5                                   itemNum ++;                            }     }


FSWindow.layout.resize();     //Resizes layout
FSWindow.onResizing = FSWindow.onResize = function () {this.layout.resize();}     //Resizes everything with panel
FSWindow.layout.layout(true);
FSWindow.center();
FSWindow.show();


}
catch(err){
    alert ("Error at line # " + err.line.toString() + "\r" + err.toString());    }

List of reference names for executeCommand();

$
0
0

Hey!

 

Does anyone know if it is possible to get a list of all the reference names for the executeCommand(); function?

 

To be more specific; i'm talking about a list of all possible "number names", like the one highlighted in red 

 

app.executeCommand(2359);

 

 

2359 = Preferences

 

 

 

JesB

copy/paste issues

$
0
0

Hi guys!

 

I been putting together a script to expedite a very long and recurrent process. It includes copying files from one OS folder to the project OS (footage) folder, importing such files into the AE project and adding them to my comp, I would like for all of this to happen within the same script.

 

Everything the way I have written in my script seems to work fine, but I did notice couple of things.

 

When copying the files from one folder to another, it takes a very long time in comparison to if I would do a manual copy paste.

 

For this, I am currently using the following function:

function copyFiles(source, targetFolder){    var source = new Folder(source);    var targetFolder = new Folder(targetFolder)      var theFolder = targetFolder.getFiles();    for(var c = 0; c < theFolder.length; c++){        if (theFolder[c] instanceof Folder){            if(theFolder[c].name == "NETWORK_BUGS"){                      targetFolder = theFolder[c];            }        }    }      var sourceFiles = source.getFiles();    for(var i = 0; i < sourceFiles.length; i++){        if(sourceFiles[i] instanceof File){            filesToCopy = sourceFiles[i]            filesToCopy.copy(new File(targetFolder+"/"+filesToCopy.name))        }    }
}

Is there a better way to do this so it can copy as fast as if I was to do it manually?

 

Also, I noticed, that this process only runs when I have ExtendScript set to run from ExtendScript, but if I set it to run from within After Effects together with the rest of the script that does the other steps within AE, it does not seem to work.

 

Thanks for any advice!!

 

Fabio

getting "ReferenceError: Object is invalid" while resetting a listBox

$
0
0

Hi

i'm trying to create a refresh button for a list (that shows the render Q better for my needs). it works fine, i'm removing all the list items and then re-entering them. for some reason when i click the same refresh button for the 6th/7th time i'm getting:

 

ReferenceError: Object is invalid

 

(it seems to be related to line 66 in the code - " curItem = folderPathListbox.add ('item', renderItem.toString());    // Column 1")

any help?

i'm lost here...

attached are the JSX and a sample project i use to test it:

 

thanks

D

 

here's the code:

 

 try{    
function createUserInterface (thisObj,userInterfaceString,scriptName){            var pal = (thisObj instanceof Panel) ? thisObj : new Window("palette", scriptName,                                        undefined,{resizeable: true});            if (pal == null) return pal;                       var UI=pal.add(userInterfaceString);                       pal.layout.layout(true);            pal.layout.resize();            pal.onResizing = pal.onResize = function () {                                                            this.layout.resize();                                                            }            if ((pal != null) && (pal instanceof Window)) {                    pal.show();            }    return UI;
};






{var res ="group {orientation:'column',\
                                    alignment:['fill','fill'],\                                    alignChildren:['fill','top'],\                                    headerText:StaticText {text:'Render Q lister', alignment:'center'},\                                    buttonGroup: Group{\                                                                alignment:['center','top']\                                                                refButton: Button{text:'Refresh'}\                                                                dupButton: Button{text:'Duplicate Selected'}\                                                                selButton: Button{text:'Select in renderQueue'}\                                                                expButton: Button{text:'Export to File'}\                                                                }\                                    folderPathListbox:ListBox{\                                                            alignment:['fill','fill'],\                                                            properties:{\                                                                            multiline:true,\                                                                            multiselect:true,\                                                                            numberOfColumns:5,\                                                                            showHeaders:true,\                                                                            columnTitles: ['Render #','Date','Time', 'Comp Name', 'Render Path']\                                                                            }\                                                            },\                        }";                       
}
function listRQ (rqList){    try{            var folderPathListbox = rqList;            var proj = app.project;            var totalRenderQ = proj.renderQueue.numItems;            for(var i= 1; i<=totalRenderQ;  i++){                    var totalOM= proj.renderQueue.item(i).numOutputModules;                     for (var om= 1; om<=totalOM; om++){                                    var dateList, timeList, curItem, renderItem;                                    renderItem =  "Render #" + i + " - " + om ;                                    if (proj.renderQueue.item(i).startTime != null){                                                var min = proj.renderQueue.item(i).startTime.getMinutes() <10 ? "0"+ proj.renderQueue.item(i).startTime.getMinutes() : proj.renderQueue.item(i).startTime.getMinutes();                                                var year = proj.renderQueue.item(i).startTime.getFullYear().toString().substr (-2,2);                                                timeList = (proj.renderQueue.item(i).startTime.getHours()-1)+":" + min;                                                dateList =proj.renderQueue.item(i).startTime.getDate()+"/"+(proj.renderQueue.item(i).startTime.getMonth()+1)+"/"+year ;                                    }else{                                                 dateList = "not rendered";                                            timeList = "    ";                                        }                                    curItem = folderPathListbox.add ('item', renderItem.toString());    // Column 1                                    curItem.subItems[0].text = dateList.toString();                         // Column 2                                    curItem.subItems[1].text = timeList.toString();                          // Column 3                                    curItem.subItems[2].text = proj.renderQueue.item(i).comp.name; // Column 4                                    curItem.subItems[3].text = proj.renderQueue.item(i).outputModule(om).file.toString().replace(new RegExp(",","g"), "\r").replace(new RegExp("%20","g"), " ").replace(new RegExp("%5B","g"), "[").replace(new RegExp("%5D","g"), "]"); // Column 5                                   }            }          }catch(err){alert(err)}    return folderPathListbox;    }


var UI = createUserInterface(this,res,"Better RQ");
var myList = UI.folderPathListbox;
var lsRq = listRQ(myList);


{ // buttons action
UI.buttonGroup.refButton.onClick = function () {
                                                                                                                                  lsRq.removeAll();                                                                        lsRq = listRQ(myList);                                                                         }
UI.buttonGroup.dupButton.onClick = function () {    alert ("Dup");    }
UI.buttonGroup.selButton.onClick = function () {    alert ("Sel");    }
UI.buttonGroup.expButton.onClick = function () {    alert ("Exp");    }
}




}
catch(err){
    alert ("Error at line # " + err.line.toString() + "\r" + err.toString());    }
Viewing all 2143 articles
Browse latest View live


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