Forum Replies Created

  • Joshua Faget

    April 26, 2017 at 7:36 pm in reply to: How to rename a file with ExtendScript?

    I don’t know how to rename a file, the other part I will figure out on my own… there isn’t much in the documentation regarding opening files with ExtendScript and etc.

  • Joshua Faget

    November 3, 2016 at 4:54 pm in reply to: Read a file with After Effects Script?

    When I do the following, im getting a blank new file.

    I’d like to be able to duplicate a .jpg file for example that way, so halfway through I can mess with the building blocks of the file.

    var file = File.openDialog();
    if (file && file.open("r")){
    var content = file.read();
    file.close();

    //do stuff to var content here

    var save = File.saveDialog();
    var newFile = new File(save);
    newFile.open("w");
    newFile.write(content);
    newFile.close;

    };

  • Joshua Faget

    November 3, 2016 at 3:33 pm in reply to: Wiggle and clamp expression

    This will change the Hue of the color only, not the saturation or brightness… you can adjust it manually from the AE color picker!

    Speed=4;
    Amount= 100; //a value between 0,100

    HSL = rgbToHsl(value);
    H = linear(wiggle(Speed,Amount)[0]/100,-1,1,0,1);
    S=HSL[1];
    L=HSL[2];
    hslToRgb([H,S,L,1])

  • Joshua Faget

    October 16, 2016 at 5:11 pm in reply to: How to get shape path vertices with script?

    I was selecting the proper thing, adding a .path fixed it!

    var selectedShape = app.project.activeItem.selectedProperties[0].path.value.vertices;

    alert(selectedShape);

  • Joshua Faget

    October 7, 2016 at 11:15 am in reply to: Absolute Layer Possition [toWorld() expression]

    Hello Dan,

    Thank you very much for your reply.

    Your solution works really well, but when the layer is a shape layer it doesn’t work unfortunately. For some bizarre reason anchor point coordinates for a solid layer and a shape layer are different, when they are in the same spot.

  • Joshua Faget

    September 26, 2016 at 9:27 am in reply to: Image path problem in After Effects script.

    Hello,

    When I run my script from “ExtendScript” with this:
    var myButton= mainGroup.add(“iconbutton”, undefined, image=”./Scripts/(ImageAssets)/MyButton.png”);

    It works, but when I save my Script and place it in the Scripts folder AND in the ScriptUI Panels folder … it stops working.

    If I change it to
    var myButton= mainGroup.add(“iconbutton”, undefined, image=”./(ImageAssets)/MyButton.png”);
    it doesn’t work neither when I run it from the Scripts folder nor when I run it from ScriptUI Panels folder…

    What I am trying to achieve is to avoid “C:/Program Files…etc”

  • Joshua Faget

    September 22, 2016 at 9:12 pm in reply to: Finding color property of a shape layer.

    Disregard my previous comment… I overly complicated it for no reason.

    alert('Thanks Xavier') // :D

  • Joshua Faget

    September 22, 2016 at 9:06 pm in reply to: Finding color property of a shape layer.

    Wow, thank you very much, this is really useful.

    But unfortunately I am running into an issue. I got it to change the fill with a value in a predefined variable, BUT it seems to be breaking the recursion when I try to slip some more information in the functions.

    var rgb = [0.5, 1, 1];

    ChangeColorButton.onClick = function() {
    var Color = rgb;

    //TheSelectedLayer
    var Selection = app.project.activeItem.selectedLayers[0];

    //RECURSION FUNCTION
    function recurseShape(g, groupHandler, rgb) {
    // g shape layer or group inside a shape ( should have a content property )
    // groupHandler : what do do with each group

    if (!g.content) return; // doesnt apply

    groupHandler(g, rgb);
    if (!g.content.property("ADBE Vector Group")) return;

    for (var n = 1; n <= g.content.numProperties; n++) {
    if (g.content.property(n).matchName === "ADBE Vector Group") recurseShape(g.content.property(n), groupHandler);
    };
    };

    //WHAT TO DO
    function myGroupHandler_changeFillToGFill(g, rgb) {
    // g shape layer or group inside a shape ( should have a content property )
    if (!g.content || !g.content.property("ADBE Vector Graphic - Fill")) return;

    for (var n = 1; n <= g.content.numProperties; n++) {
    if (g.content.property(n).matchName === "ADBE Vector Graphic - Fill") {
    g.content.property(n).property(4).setValue(rgb);
    };
    };
    };

    //EXECUTION
    app.beginUndoGroup("Change Fills to G-Fills");
    recurseShape(Selection, myGroupHandler_changeFillToGFill, Color);
    app.endUndoGroup();

    }

  • Joshua Faget

    September 14, 2016 at 6:31 pm in reply to: How to close a ScriptUI element?

    Thank you very much…

    While my post was pending review, I’ve figured out a way to do it by resizing it to 0, but your solution is much more elegant.
    I tried it before, but couldn’t figure out exactly how it works…

    Thanks a bunch.

    alert('Thank You') // :D

  • Joshua Faget

    September 14, 2016 at 6:14 pm in reply to: How to close a ScriptUI element?

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