Quantcast
Channel: Adobe Community : Popular Discussions - Premiere Pro SDK
Viewing all articles
Browse latest Browse all 53010

Premiere Pro & ExtendScript

$
0
0

Notice the following section of code:

 

for (i = 0; i <= app.project.rootItem.children.numItems; i++)

    {

        if (app.project.rootItem.children[i].getMediaPath().indexOf('(PREV)') > -1)

    {

        var BCVpath = "D:\4) Videos\Dummy(PREV).psd"

        app.project.rootItem.children[i].changeMediaPath(BCVpath);

    }

    }

 

What I intend for this to do is search through all of the currently imported files in the current project and, once a file containing the text "(PREV)" is found, replace that file with another one at a specified, absolute, hard-coded directory.  However, the script has two problems:

 

  1. Upon running the code from ExtendScript, I receive this error in Premiere Pro.  I have only one file containing the text "(PREV)" imported into my project.
    7f4cbfddb9614afbbf1d7831ac970e3e.png
  2. Which is then followed by an error that only appears within ExtendScript (after clicking OK on the dialogue box):
    8dc0d140d4b547bbb540bbe9e7ad7b33.png

I do not understand how to create an absolute file path reference for use with the .changeMediaPath()

I also cannot figure out why ExtendScript gives me the undefined is not an object error AFTER it has already "successfully" executed the entire script.  Can somebody please offer some insight as to what I need to fix since there is so little documentation for Premiere Pro and ExtendScript?


Viewing all articles
Browse latest Browse all 53010

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>