Oh yeah I think I had a lucky guess on the changes on the script. It worked for me 🙂
here is how I’ve tried changing them:
{
function main(){
var myComp = app.project.activeItem;
if ((myComp == null) || ! (myComp instanceof CompItem)){
alert("No comp selected.");
return;
}
if (myComp.selectedLayers.length == 0){
alert("No layer selected.");
return;
}
var myLayer = myComp.selectedLayers[0];
if (!(myLayer instanceof TextLayer)){
alert("Selected layer is not text layer");
return;
}
var myProp = myLayer.property("Text").property("Source Text");
for (var i = myProp.numKeys; i > 1; i--){
if (myProp.keyValue(i) == " "){
myProp.removeKey(i);
}
}
}
main();
}
Thanks Dan for the script~! 🙂
For my last question, how do you modify the script if I wanted to select multiple text layers in the composition and delete these keyframes with space in text layers? THANKS!