2 Replies Latest reply on May 23, 2017 8:11 AM by FizzPow

    Get frame animation Loop Info


      I am writing a script that exports the frame animation information from Photoshop timeline to a json file our game can load.  I have it exporting the frame order, names and delays just fine now, but I can't find a way to access whether the entire animation is set to loop once, 3 times, forever, etc.  I have seen some scripts on how to set the loop count, but nothing about how to read it?


      Much thanks for any help!

        • 1. Re: Get frame animation Loop Info
          c.pfaffenbichler Level 9

          #target photoshop

          alert (getAnimationLoopCount ());

          ////// get framedelay //////

          function getAnimationLoopCount (theIndex) {

          var ref = new ActionReference(); 

          ref.putProperty(charIDToTypeID('Prpr'), stringIDToTypeID('animationLoopCount')); 

          ref.putEnumerated(stringIDToTypeID('animationClass'), charIDToTypeID( "Ordn" ), charIDToTypeID( "Trgt" ));

          var desc=new ActionDescriptor(); 

          desc.putReference(charIDToTypeID('null'), ref);          

          var aaa = executeAction(charIDToTypeID('getd'), desc, DialogModes.NO);

          return aaa.getInteger(stringIDToTypeID('animationLoopCount'))


          • 2. Re: Get frame animation Loop Info
            FizzPow Level 1

            This works perfectly, thanks so much!!!!!