Forum Replies Created

Page 1 of 2
  • Rodrigo Aben

    October 16, 2022 at 1:21 am in reply to: Compare Arrays in Extendscript

    That solved beautifully, Filip. Thanks a lot!

  • Rodrigo Aben

    October 15, 2022 at 3:51 am in reply to: Compare Arrays in Extendscript

    Function .includes does not exist on extendscript

  • Rodrigo Aben

    July 2, 2022 at 2:22 am in reply to: Access Smoother Panel via Scripting

    Actually it seems there’s no command ID for the smoother

  • Rodrigo Aben

    September 11, 2020 at 7:40 pm in reply to: Link Master Properties to CSV file

    Cant’t you just replace the “TEXT 01” by “TEXT” + thisLayer.index ?

  • Rodrigo Aben

    September 10, 2020 at 6:42 pm in reply to: Detect which edittext is activated

    BTW, I keep having no ideia of how .onActivate() works. Tryied different things but none of them returns anything.

  • Rodrigo Aben

    September 10, 2020 at 6:41 pm in reply to: Detect which edittext is activated

    Solved! Logical problem actually. I was adding the event listener to the window and not to the actual group. This is the proper way to write it:

    var win = new Window ("dialog");
    var maingroup = win.add ("panel {orientation: 'column'}");
    add_row (maingroup);
    var show_btn = win.add ("button", undefined, "Save presets");
    show_btn.onClick = function () {
    var txt = "";
    for (var n = 0; n < maingroup.children.length; n++) {
    txt += maingroup.children[n].edit.text + "\n";
    }
    alert ("Rows: \n" + txt);
    }
    win.show ();
    function add_row (maingroup) {
    var group = maingroup.add ("group");
    group.statictext = group.add ("statictext", undefined, "Left-click +");
    group.edit = group.add ("edittext", ["", "", 200, 20], "Click here and press any key");
    group.plus = group.add ("button", undefined, "+");
    group.plus.onClick = add_btn;
    group.minus = group.add ("button", undefined, "-");
    group.minus.onClick = minus_btn;
    group.index = maingroup.children.length - 1;
    group.addEventListener ("keydown", function (kd) {pressed (kd)});
    function pressed (k) {
    if(k.keyName === "Enter"){
    group.edit.text = "Enter";
    }
    }

    win.layout.layout (true);
    }
    function add_btn () {
    add_row (maingroup);
    }
    function minus_btn () {
    maingroup.remove (this.parent);
    win.layout.layout (true);
    }
  • Rodrigo Aben

    July 30, 2020 at 8:05 pm in reply to: Jagged Text in After Effects

    Seems like your comp is too small or preview quality is set to “half”. Maybe you could share your project so we can check it.

  • Rodrigo Aben

    July 27, 2020 at 12:14 am in reply to: Importing unique files only

    Sorry for bothering you too much, but I know I’ll face a whole new problem in case the “unique” file detected is part of a image sequence. Any insights on how to go about that?

  • Rodrigo Aben

    July 27, 2020 at 12:03 am in reply to: Importing unique files only

    Great solution, Filip! Thank you very much. I had no idea they would not be considered equal. Could you elaborate more on that?

    BTW I would also like to avoid nesting functions and loops, but since folder.getFiles() only works one folder at a time, running this function seemed to me the simplest way of looping through all folders.

    My full code below in case you see any room for improvement (and you probably will).

    Thank you very much once again.

    var myProj = app.project;

    //creates an array of all file's folders

    var myAssetspath = [];

    for (var i = 1; i &lt;= myProj.numItems; i++) {
    var filesPath = app.project.item(i).file.fsName.replace(app.project.item(i).name, "");
    myAssetspath.push(filesPath);
    }

    //this sorts the array

    var mySortedFolders = myAssetspath.sort();

    //removes duplicate folders

    var myUniqueFolders = [];

    for (var i = 0; i &lt;= mySortedFolders.length; i++){
    if(mySortedFolders[i] != mySortedFolders[i+1]){
    myUniqueFolders.push(mySortedFolders[i]);
    }
    }

    // gets files from all unique folders and tests if they're already imported. If not, imports them

    for (var i = 0; i &lt; myUniqueFolders.length; i++){

    // function ImportUniqueFiles(){
    var folder = new Folder;
    folder = Folder(myUniqueFolders[i]);

    var files = folder.getFiles();
    // convert the list of File-Objects to a list of Strings of their Paths
    files = files.map( function (f) { return f.absoluteURI });

    myImportedFiles = [];

    for (var k = 1; k &lt;= myProj.numItems; k++) {
    var thisFile = app.project.item(k).file;
    // many compItems don't have a file as source
    if (thisFile !== null && thisFile !== undefined) {
    myImportedFiles.push(thisFile.absoluteURI);
    }
    }
    alert(myImportedFiles.length);

    importFiles(files);

    function importFiles(files) {
    for(var j = 0; j &lt; files.length; j++) {
    $.writeln(myImportedFiles.indexOf(files[j]));
    if(myImportedFiles.indexOf(files[j]) == -1){
    alert(files[j]);
    app.project.importFile(new ImportOptions(files[j]));
    }else{
    alert("not unique");
    }
    }
    }
    }

  • Rodrigo Aben

    July 15, 2020 at 5:15 am in reply to: Function works on dialog but not on a palette

    Turns out, Thomas was right. Sorry for the delay guys but your help has been amazing. These are the projects I’ve been able to create with it http://www.abenathar.com

Page 1 of 2

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy