5 Replies Latest reply on Jan 5, 2012 4:55 AM by Rick Gerard

    After Effects CS5.5 jsx script: How to access Cue Point Time???

    tinfanide
      {
          
      var myComp = app.project.activeItem;
      
      if (myComp && myComp instanceof CompItem){ 
          
         var selLayers = myComp.selectedLayers;
         var myMarker = selLayers[0].property("Marker"); 
         var curMarker = myMarker.keyValue(1);
         var curTime = myMarker.keyTime(1);
         
      curMarker.time = "00:00:00:01";
      myMarker.setValueAtKey(1,curMarker);
         
          }
          
      }
      

       

      Hello, as I want to extract the hh:mm:ss:ff time data from a video embedded with XMP metadata in After Effects in batch.

      I wonder how I can get access to a cue point time and duration?

      I know properties like

       

      curMarker.comment

      curMarker.cuePointName

      curMarker.chapter

       

      Yet, I failed in getting access to time, duration...

      Could someone who knows it point me to a Adobe Javascript reference?

      I couldn't find one online.

      Many thanks!

        • 1. Re: After Effects CS5.5 jsx script: How to access Cue Point Time???
          Rick Gerard Adobe Community Professional & MVP

          This question is probably best answered in the After Effects scripting forum. The LINK is at the top left of this forum when viewed in Display mode or in the far right column in the other views.

           

          Are you asking to read the original timecode of the clip, or the total length of the clip, or the total time from in point to out point, or the timecode of the marker?

          • 2. Re: After Effects CS5.5 jsx script: How to access Cue Point Time???
            tinfanide Level 1

            Yes, I want to read the timecodes and make use of them in the following tasks:

             

            My actual job is to batch extract the timecode (hh:mm:ss:ff) and copy them and paste on a text file.

            My intention is to:

            1. batch copy the timecodes

            2. batch paste on a text file

            3. Compare the timecodes with cuepoint time value

             

            Because as you may know from my last question here, I want to figure out

            how to convert Cue Point XML time (in milliseconds) to hh:mm:ss:ff so that

            I can generate an Encore Subtitle Text.

             

            The workflow is like:

             

            From a Cue Point XML (exported from Flash / Soundbooth):

             

            <CuePoint>

            <Time>1002</Time>

            <Type>navigation</Type>

            <Value>First</Value>

            </CuePoint>

            <CuePoint>

            <Time>1002</Time>

            <Type>navigation</Type>

            <Value>Second</Value>

            </CuePoint>

             

            To an Encore Text:

            1 hh:mm:ss:ff hh:mm:ss:ff First

            2 hh:mm:ss:ff hh:mm:ss:ff Second

             

            The problem I have got hung up is that I do not know the exact relationship between Cue Point XML Time and hh:mm:ss:ff in Encore Subtitle

            Now I reach the stage that I know how to convert

            From CuePoint Time to hh:mm:ss:sss (Milliseconds)

            But not hh:mm:ss:ff (Frames)

             

            Originally I wished Adobe auto does the Cuepoints to Encore subtitles job for me. Yet it seems not possible without scripting.

            I hope I've been explaining it in a clear manner.

            Thanks for your reply.

            • 3. Re: After Effects CS5.5 jsx script: How to access Cue Point Time???
              Rick Gerard Adobe Community Professional & MVP

              It looks like a simple time to timecode function. I haven't got time to check in the extended script toolkit this morning but if you put an expression in a text layer you'll get a visible timecode display. I think the expression goes like this but there may be a capitalization error here or there:

               

              timeToNTSCTimecode(t = time, ntscDropFrame = true)
              

               

              You can add values to time that make corrections for in point of the layer by subtracting thisLayer.inPoint from the time. I'm not sure if an expression can read the metadata timecode from a video clip.

               

              If I get some time I'll check this out in the script editor. I can't do scripting in my head.

              • 4. Re: After Effects CS5.5 jsx script: How to access Cue Point Time???
                tinfanide Level 1

                Can I ask where I should use this expression in After Effects and

                any online reference on this?

                • 5. Re: After Effects CS5.5 jsx script: How to access Cue Point Time???
                  Rick Gerard Adobe Community Professional & MVP

                  Apply the timeToNTSCTimeode expression to Source Text on a blank text layer. That's all there is to it.