Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Forums Adobe After Effects Interesting problem with changing multiple text layers

  • Interesting problem with changing multiple text layers

     Filip Vandueren updated 2 weeks ago 2 Members · 3 Posts
  • Nebo Beat

    September 12, 2020 at 8:08 pm

    Well, at least I hope it’s interesting for someone, enough so there will be some helpful info:D
    I found no solution anywhere, or anyone asking for something similar at all hm…

    So, I have several projects with lots of different text layers…Small amount of text per layer, but many layers. They are in CYRILIC. Now, I need to replace all of text with regular LATIN letters – same text and everything, just every text layer to be Latin, not Cyrilic.
    Pleasee relieve me from painful manual retyping and tell me there is a script or some trick that can do this? 🙂 It’s not that it’s just manual work, with so many projects and text layers, mistakes will be made etc…
    thanksss

  • Filip Vandueren

    September 13, 2020 at 12:13 pm

    But then “Ж” would have to become “zh” ?

  • Filip Vandueren

    September 13, 2020 at 12:59 pm

    Here’s a script that changes all the Cyrillic texts to latin in the current comp,
    some formatting will get lost, but that’s a limitation of After Effects.

    app.beginUndoGroup("Cyrillic to Latin");

    var thisComp = app.project.activeItem;

    if (!thisComp.layers) $.writeln("no layers");

    else {

    for(var i=1; i<=thisComp.numLayers; i++) {

    var l = thisComp.layer(i);

    if (l.hasOwnProperty("ADBE Text Properties")) {

    var txt = l("ADBE Text Properties")("ADBE Text Document");

    if (txt.numKeys) {

    for(var j=1; j<=txt.numKeys; j++) {

    txt.setValueAtKey(j, transliterate(txt.keyValue(j)));

    }

    } else {

    txt.setValue(transliterate(txt.value));

    }

    }

    }

    }

    // from @briemens via https://stackoverflow.com/questions/11404047/transliterating-cyrillic-to-latin-with-javascript-function

    var a = {"Ё":"YO","Й":"I","Ц":"TS","У":"U","К":"K","Е":"E","Н":"N", "Г":"G","Ш":"SH","Щ":"SCH","З":"Z","Х":"H","Ъ":"'","ё":"yo","й":"i", "ц":"ts","у":"u","к":"k","е":"e","н":"n","г":"g","ш":"sh","щ":"sch", "з":"z","х":"h","ъ":"'","Ф":"F","Ы":"I","В":"V","А":"a","П":"P","Р":"R", "О":"O","Л":"L","Д":"D","Ж":"ZH","Э":"E","ф":"f","ы":"i","в":"v","а":"a", "п":"p","р":"r","о":"o","л":"l","д":"d","ж":"zh","э":"e","Я":"Ya","Ч":"CH", "С":"S","М":"M","И":"I","Т":"T","Ь":"'","Б":"B","Ю":"YU","я":"ya","ч":"ch", "с":"s","м":"m","и":"i","т":"t","ь":"'","б":"b","ю":"yu"};

    function transliterate(word){

    return word.toString().split('').map(function (c) {

    return a[c] || c;

    }).join("");

    }

    app.endUndoGroup();

Viewing 1 - 3 of 3 posts

Log in to reply.

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