Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Unable to edit the Type Tool text using ExtendScript

New Here ,
Feb 02, 2023 Feb 02, 2023

Hi All,

Any idea how to edit the text of "Type Tool" using ExtendScript?

d82krai_0-1675344865214.pngexpand image

 

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

 

 

TOPICS
Editing , How to , SDK
524
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 3 Correct answers

New Here , Feb 02, 2023 Feb 02, 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');
                }
Translate
Adobe Employee , Feb 02, 2023 Feb 02, 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

Translate
Adobe Employee , Feb 12, 2023 Feb 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.

Translate
New Here ,
Feb 02, 2023 Feb 02, 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');
                }
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Feb 02, 2023 Feb 02, 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/PPR...

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Feb 12, 2023 Feb 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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Feb 12, 2023 Feb 12, 2023
LATEST

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines