Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Forums Adobe After Effects Expressions copy markers from layer markers to comp markers

  • copy markers from layer markers to comp markers

  • Roei Tzoref

    July 13, 2016 at 1:10 pm

    hey everybody.
    I have a guide layer with layer markers and I have to manually at every comp set those markers to the comp markers.
    won’t you give a guy a hand?

  • Dan Ebberts

    July 13, 2016 at 4:39 pm

    Strangely, scripting doesn’t have direct access to comp markers. This hack should give you comp markers wherever you have markers on a selected layer, but I don’t think there’s any way to copy the comment:


    var theComp = app.project.activeItem;
    var theLayer = theComp.selectedLayers[0];
    var theTimes = [];
    for (var i = 1; i <= theLayer.property("Marker").numKeys; i++){
    theTimes.push(theLayer.property("Marker").keyTime(i));
    }
    for (var i = 1; i <= theComp.numLayers; i++){
    theComp.layer(i).selected = false;
    }
    for (var i = 0; i < theTimes.length; i++){
    theComp.time = theTimes[i];
    app.executeCommand(app.findMenuCommandId("Add Marker"));
    }

    Dan

  • Roei Tzoref

    July 13, 2016 at 7:13 pm

    thank you Dan. at which property, and what composition should I copy this expression too?

  • Dan Ebberts

    July 13, 2016 at 7:21 pm

    It’s a script, not an expression.

    Dan

  • Roei Tzoref

    July 13, 2016 at 7:38 pm

    Got it! it Works! Dan let’s make some money 🙂 this could be very useful at Aescripts. first time I copy pasted a string to the script editor and saved it as a jsx – is that how you started :0

  • Roei Tzoref

    July 13, 2016 at 7:42 pm

    I was thinking of something. is there a way to make this script just add “1”, “2”, “3” etc. to the markers it copies to the comp? just to not leave them blank. that could improve it’s purpose a lot

  • Roei Tzoref

    July 13, 2016 at 7:50 pm

    I am trying to have it close instead of loading that Jsx everytime.

    tried copying it to the scripts folder and restarted Ae and it’s not in File-Scripts.
    copying it to the startup folder in scripts gave an error message when loading Ae.

    is there a way for having it close. of course a docking or a window near by would be great but I am not spoiled. I just want it to be quicker than loading it every time with File->Scripts->Run Script File->clicking on it twice in my Explorer but if that’s all I get I will take it.

    Running Ae 13.8

  • Dan Ebberts

    July 13, 2016 at 7:51 pm

    >this could be very useful at Aescripts

    It would need some work to make it user-proof, run in different languages, etc. I’m not sure there’s any money to be made there.

    >is that how you started :0

    Not exactly. In the early days, I’d write the code in Notepad and just save it as a .jsx. Now I usually (unless it’s a really short piece of code, like this one) use the ExtendScript editor, or Sublime Text.

    Dan

  • Dan Ebberts

    July 13, 2016 at 7:55 pm

    >I am trying to have it close

    I’m not sure what you mean by that.

    Dan

  • Dan Ebberts

    July 13, 2016 at 7:56 pm

    >is there a way to make this script just add “1”, “2”, “3” etc. to the markers it copies to the comp?

    Not that I know of.

    Dan

Viewing 1 - 10 of 25 posts

Log in to reply.

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