Skip to main content
New Participant
February 2, 2023
Answered

Unable to edit the Type Tool text using ExtendScript

  • February 2, 2023
  • 2 replies
  • 726 views

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);
                }
                
            }
        }
    }
}

 

 

This topic has been closed for replies.
Correct answer Bruce Bullis

>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.

2 replies

Bruce Bullis
Community Manager
Community Manager
February 2, 2023

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

New Participant
February 12, 2023

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

Bruce Bullis
Community Manager
Bruce BullisCommunity ManagerCorrect answer
Community Manager
February 12, 2023

>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.

d82kraiAuthor
New Participant
February 2, 2023

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');
                }