Created
February 20, 2015 06:34
-
-
Save dokluch/c997f1fd59447fa698d1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
*Snippet to change target name project-wise. | |
*Comp names and layer names are going to be affected. | |
*I believe there are going to be problems with expressions. | |
*Though I'm not sure | |
* | |
*CC-BY, Nik Ska, 2015 | |
*/ | |
var wrongName = "СС"; | |
var targetName = "WATWAT"; | |
var howMuch = 0; | |
app.beginUndoGroup("Changeallnames"); | |
for(var i = app.project.numItems; i > 0; i--){ | |
var thisItem = app.project.item(i); | |
if(thisItem.name == wrongName){ | |
thisItem.name = targetName; | |
howMuch++; | |
} | |
if(thisItem instanceof CompItem){ | |
for(var c = thisItem.layers.length; c > 0; c--){ | |
var thisLayer = thisItem.layers[c]; | |
if(thisLayer.name == wrongName){ | |
thisLayer.name = targetName; | |
thisLayer.selected = true; | |
thisItem.openInViewer(); | |
howMuch++ | |
} | |
} | |
} | |
} | |
alert("Changed " + String(howMuch) + " names"); | |
app.endUndoGroup(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment