Question
getParamForDisplayName("Source Text") and getValue() and setValue() are not working in component obj
I have three diffucility in my code.
Firstly
textObjComponent.properties.getParamForDisplayName("Source Text")
is returns "Failed to retrieve variables. Details: Error processing request: XML error in line 1
- Not well-formed (invalid token)"
Secondly my text component has a "Customer Name" text but this code
textObjComponents[4].properties.getParamForDisplayName("Source Text").getValue()returns "Ũ" I dont know what is this.
Thirdly
When I run this code
textObjComponents[4].properties.getParamForDisplayName("Source Text").setValue("aaa")
in Premiere Pro component instanceName and display text is gone and I can not understand what is the problem.
my full code is this:
var projectPath="my_path";
if (app.isDocument(projectPath)) {
app.openDocument(projectPath);
var project = app.project;
var tracks=app.project.activeSequence.videoTracks;
var textObj=null;
breakFlag=false;
for (var i=0, len=tracks.length; i < len ; i++) {
clips=tracks[i].clips;
for (var j=0, len=clips.length; j < len ; j++) {
var clipObjectName=clips[j].name;
if(clipObjectName=="texts"){
textObj=clips[j];
breakFlag=true;
break;
}
}
if(breakFlag){
break
}
};
textObjComponents=textObj.components;
for (var i=0, len=textObjComponents.length; i < len ; i++) {
textObjComponent=textObjComponents[i];
if (textObjComponent.displayName=="Text"){
3+5;
}
}
} else {
alert(projectPath+" This document cant open.");
}
