Forum Replies Created

Viewing 1 - 10 of 231 posts
  • Scott McGee

    October 11, 2021 at 4:31 pm

    Hey Sami,

    Not too sure what you might be having trouble with but just incase.

    If you’ve copied and pasted into Extendscript, make sure “” aren’t “”. I’ve noticed the code I’ve copied and pasted back then did that has done that. So they’ll need to be swapped. Same goes for ” and ‘’

    Once these have been replaced then it should work no problem.

    If not, can you specify what the error is coming back with, but it should be saying something on the lines of.

    unable to execute script at line 1. syntax error

    If it’s saying something like this, then it’s the “” and ”.

    Hope that helps.

  • Scott McGee

    September 28, 2020 at 8:00 am

    This will help you get started

    segDur = 1;

    minVal = [0.1*thisComp.width, 0.1*thisComp.height];

    maxVal = [0.9*thisComp.width, 0.9*thisComp.height];

    seed = Math.floor(time/segDur);

    segStart = seed*segDur;

    seedRandom(seed,true);

    startVal = random(minVal,maxVal);

    seedRandom(seed+1,true);

    endVal = random(minVal,maxVal);

    ease(time,segStart,segStart + segDur, startVal, endVal);

    This was by Dan Ebberts from his website here https://motionscript.com/mastering-expressions/random-1.html

    As for the pause in the middle. I don’t have time to write some up, but you should be able to add a delay between each movement.

    Hope this steers you in the right direction.

  • Scott McGee

    September 15, 2020 at 4:56 pm

    It’s because I copied and pasted and my “” changed to ““…And yes that does matter. Now if you copy and paste below. It will work. Slight Smile

    var mySelectedItems = [];

    for (var i = 1; i <= app.project.numItems; i++){

    if (app.project.item(i).selected)

    mySelectedItems[mySelectedItems.length] = app.project.item(i);

    }

    for (var j = 0; j < mySelectedItems.length; j++) {

    var comp = app.project.selection[j];

    var origCompSize = [comp.width,comp.height];

    var newCompSize = [origCompSize[0] + 300, origCompSize[1] +100];

    comp.width = newCompSize[0];

    comp.height = newCompSize[1];

    comp.layer(1).property(“Position”).setValue([comp.width/2,comp.height/2]);

    }

  • Scott McGee

    September 9, 2020 at 8:13 am

    As long are you are changing the anchor point when it’s placed into the comp in the first place.

    This should work 🙂

    var mySelectedItems = [];

    for (var i = 1; i <= app.project.numItems; i++){

    if (app.project.item(i).selected)

    mySelectedItems[mySelectedItems.length] = app.project.item(i);

    }

    for (var j = 0; j < mySelectedItems.length; j++) {

    var comp = app.project.selection[j];

    var origCompSize = [comp.width,comp.height];

    var newCompSize = [origCompSize[0] + 300, origCompSize[1] +100];

    comp.width = newCompSize[0];

    comp.height = newCompSize[1];

    comp.layer(1).property(“Position”).setValue([comp.width/2,comp.height/2]);

    }

  • Scott McGee

    August 24, 2020 at 4:36 pm

    That was quicker than I thought it would be to write.

    var mySelectedItems = [];
    for (var i = 1; i <= app.project.numItems; i++){
    if (app.project.item(i).selected)
    mySelectedItems[mySelectedItems.length] = app.project.item(i);
    }

    for (var j = 0; j < mySelectedItems.length; j++) {
    var comp = app.project.selection[j];
    var origCompSize = [comp.width,comp.height];
    var newCompSize = [origCompSize[0] + 300, origCompSize[1] +100];
    comp.width = newCompSize[0];
    comp.height = newCompSize[1];
    }

    Any comps you select in the project window will be increased by 300 width and 100 height.

  • Scott McGee

    August 24, 2020 at 4:11 pm

    Simple answer is yes.

    Not sure if you are wanting to change 100 in one click or as you are importing the files.

    but I don’t know if there is a free or purchase script to do the job, but if you are comfortable with scripting. Essentially this is it

    var comp = app.project.activeItem;
    comp.width = 1920;
    comp.height = 1080;

    You can adapt to take the original size

    var comp = app.project.activeItem;
    var origCompSize = [comp.width,comp.height];

    var newCompSize = [origCompSize[1] + 300, origCompSize[0]+100];

    comp.width = newCompSize[0];
    comp.height = newCompSize[1];

    That will change the size of the active comp open in AE, but if you stick that into a loop of selected comps (little more complex, not that much) in the project window that will resize all the comps based on their size and add 300px width and 100px height.

  • Scott McGee

    August 24, 2020 at 3:55 pm

    Personally I’d just include an update button and function that to update/refresh the menu. There’s plenty of bits about on this sort of thing if you want it to update. (attached some code below)

    Depending on what you want this menu to do. I.e if you have a few scripts you want to combine, have you thought about tabbed panels to switch between them.

    If it’s data you want to pull from the project and have it update in the script panel. Then back to the first solution of adding and update/refresh button.

    If you are opening whilst AE is already open and opening another project. The script doesn’t know this as it doesn’t reverse communicate. You’d have to put in app.project.close() and app.open() into your script and trigger this, you’d need to include save if you wanted it to save. But then you’d still be using the above function of updating and/or refreshing the panel still.


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

    var mainGroup = myPanel.add("group");
    var btn = mainGroup.add("button",undefined,"Update");

    btn.onClick = function () {
    cleanUpGroup(grpContainer);
    var btn1_1 = grpContainer.add("button", undefined, "1_1");
    var btn1_2 = grpContainer.add("button", undefined, "1_2");
    var btn1_3 = grpContainer.add("button", undefined, "1_3");
    var btn1_4 = grpContainer.add("button", undefined, "1_4");
    updatePanel(myPanel);
    };

    var grpContainer = myPanel.add("group");

    // Setup panel sizing and make panel resizable
    myPanel.layout.layout(true);
    myPanel.layout.resize();
    myPanel.onResizing = myPanel.onResize = function () {this.layout.resize();}

    return myPanel;
    }

    function cleanUpGroup(container) {
    while (container.children[0]) {
    container.remove(container.children[0]);
    }
    }

    function updatePanel(win) {
    win.layout.layout(true);
    }

    // Build script panel
    var myScriptPal = myScript_buildUI(thisObj);

    if ((myScriptPal != null) && (myScriptPal instanceof Window)) {
    myScriptPal.center();
    myScriptPal.show();
    }
    }

    // Execute script
    myScript(this);
    }

    This updates the panel and might be of help to you possibly.

  • Scott McGee

    August 24, 2020 at 11:01 am

    I don’t think that is possible. Even using the expression function, AE has inbuilt support to parse it in the background. However I don’t know if that is done when importing. If you trying and access it in the project file like so


    app.project.selection[0].file;
    alert(file);

    you get the filePath and if you try this like a json file

    app.project.selection[0].file;
    alert(file[0]);

    you get undefined. So I assume that AE does something in the background that you just can’t do with extend script and extend script doesn’t have the ability to natively read Json.

    However if your json file is in the timeline you can access that data using extend script easily by accessing the properties. Tried to go backwards from there, but kept getting undefined. So unless anyone jumps in, unfortunately the script I wrote a few years back is the only way to still access json from the project window.

    It just allows you to skip selecting a file from a folder or having the script remember the file pat. So there is some benefit.

    I prefer using script to expressions, purely because it when it comes to exporting. It is so much faster. I know AE is getting better, but when you have hundreds of expressions. It slows down export time dramatically.

  • Scott McGee

    August 21, 2020 at 2:24 pm

    Ignore me, just watched it and it’s manually done.

    However Tomas who’s a regular boffin on here created this. Which is what you’re after. Or can guide you better.

    https://www.youtube.com/watch?v=A3_0aAVegc8

    Some contents or functionalities here are not available due to your cookie preferences!

    This happens because the functionality/content marked as “Google Youtube” uses cookies that you choosed to keep disabled. In order to view this content or use this functionality, please enable cookies: click here to open your cookie preferences.

  • Scott McGee

    August 21, 2020 at 2:19 pm

    Found this for you that might offer the answer you seek

    https://www.youtube.com/watch?v=Nn4biGJScsU

    Some contents or functionalities here are not available due to your cookie preferences!

    This happens because the functionality/content marked as “Google Youtube” uses cookies that you choosed to keep disabled. In order to view this content or use this functionality, please enable cookies: click here to open your cookie preferences.

Viewing 1 - 10 of 231 posts

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