Copy link to clipboard
Copied
Hi All,
Any idea how to edit the text of "Type Tool" using ExtendScript?
I tried to modify the text using below script but it is making the clip empty(removing the existing text).
for(var a = 0; a < app.project.sequences[0].videoTracks.length; a++)
{
var videoTracks = app.project.sequences[0].videoTracks[a];
for(var b=0; b< app.project.sequences[0].videoTracks[a].clips.length; b++)
{
var clip = app.project.sequences[0].videoTracks[a].clips[b];
$.writeln(clip.name);
for(var c=0; c < app.project.sequences[0].videoTracks[a].clips[b].components.length; c++)
{
var component = app.project.sequences[0].videoTracks[a].clips[b].components[c];
for(var d=0; d < app.project.sequences[0].videoTracks[a].clips[b].components[c].properties.length; d++)
{
var prop = app.project.sequences[0].videoTracks[a].clips[b].components[c].properties[d];
//$.writeln(prop.displayName + " = " + prop.getValue());
if(clip.name == 'Graphic')
{
$.writeln(prop.displayName);
}
if(prop.displayName == 'Source Text')
{
$.writeln(prop.displayName);
}
}
}
}
}
3 Correct answers
Sorry forgot to add the code for modifying the text. Here is the code:
if(prop.displayName == 'Source Text')
{
$.writeln(prop.displayName);
prop.setValue('Some dynamic text');
}
There is no API for doing so.
Note that it is possible to modify parameters of an instantiated .mogrt which have been declared as modifiable; here's PProPanel inserting a .mogrt, then modifying its text fields.
https://github.com/Adobe-CEP/Samples/blob/7ff483d0aa90e2f2f83b6e327579d5dabeae49c5/PProPanel/jsx/PPRO/Premiere.jsx#L1865
>Is there an update on this please?
There have been no changes.
The existing API can be used as referenced/demonstrated [above]; no further ExtendScript API expansion is planned or scheduled.
Copy link to clipboard
Copied
Sorry forgot to add the code for modifying the text. Here is the code:
if(prop.displayName == 'Source Text')
{
$.writeln(prop.displayName);
prop.setValue('Some dynamic text');
}
Copy link to clipboard
Copied
There is no API for doing so.
Note that it is possible to modify parameters of an instantiated .mogrt which have been declared as modifiable; here's PProPanel inserting a .mogrt, then modifying its text fields.
https://github.com/Adobe-CEP/Samples/blob/7ff483d0aa90e2f2f83b6e327579d5dabeae49c5/PProPanel/jsx/PPR...
Copy link to clipboard
Copied
Is there an update on this please?
I am creating captions, when using "Upgrade Caption To Graphic". I then need to edit the generated graphics to capitalise only the first letters and run a find/replace using a regex
Copy link to clipboard
Copied
>Is there an update on this please?
There have been no changes.
The existing API can be used as referenced/demonstrated [above]; no further ExtendScript API expansion is planned or scheduled.

