1 Reply Latest reply on Jun 9, 2010 8:10 AM by Deyerle Melody

    Scripting Movie Poster Type

    Deyerle Melody

      Hello Adobe Community,


      I wrote a script that "converts" all streaming videos to embedded videos; however, after I set each video's filePath, it loses its poster.  I have a line of code that is supposed to set the moviePosterType to the first frame of the movie:


      myPageItems[i].moviePosterType = 1298558310; //FROM_MOVIE


      where myPageItems[i] is an instanceof a Movie from my app.activeDocument.allPageItems


      Here is the bulk of the code and all of it appears to work, barring setting the movie poster type.


      function embedVideos() {

          var myFilePath = "the real file path would be here";


          var myDelimiter = "/";

          var myPageItems = app.activeDocument.allPageItems;

          var myUrlPath;

          var count = 0;


          for (var i = 0; i < myPageItems.length; i++) {

              if (myPageItems[i] instanceof Movie) {

                  if (myPageItems[i].filePath) {

                  } else {

                      myUrlPath = myPageItems[i].url;

                      myUrlPath = myUrlPath.split(myDelimiter);

                      myPageItems[i].filePath = myFilePath + myUrlPath[myUrlPath.length-1];

                      myPageItems[i].moviePosterType = 1298558310; //FROM_MOVIE




          } //end for-loop

          return alert(count + " videos will be converted to embedded.");

      } //end function embedVideos


      For debugging purposes, after each attempt to set the movie poster type, an alert() says the poster type is "NONE," unless I manually set the poster, then it will say "FROM_MOVIE."  My goal is to automatically set the movie poster type, otherwise someone would need to click on every video to set it.  Thanks in advance for any insight or ideas!

        • 1. Re: Scripting Movie Poster Type
          Deyerle Melody Level 1

          I was thinking a possible solution would be to automate/script the process a user would normally complete through the menu system.  To set a poster to "From Current Frame," a user would open the Media panel, click on the "Poster:" drop-down, and select "From Current Frame."


          After looking through the available Menu Names and Menu Actions, the only handles I see available are "Media," "Video from URL...," and "PDF Options...."  Does anyone know if I can access the Media > Poster > From Current Frame option through scripting?


          Thanks for any ideas!