3 Replies Latest reply on Oct 7, 2015 7:51 AM by Bruce Bullis

    How to Clear the previous marker info

    anoopnr134 Level 1

      Hi All,

       

      When we import a media and create some markers for that and delete the media and import again, the last created markers seems to be there again, coz of some caching in Premiere.

      Is there any way to clear all the Previous markers created last time for an asset which persists during the next asset import also from extendscript?

      We can get the marker object for an item from

      markers = proj_item.getMarkers(); is there any way to delete these markers directly from  proj_item/markers  object?


      Thanks and Regards,

      Anoop NR

        • 1. Re: How to Clear the previous marker info
          Bruce Bullis Adobe Employee

          markers.deleteMarker(markerToDelete);

          • 2. Re: How to Clear the previous marker info
            anoopnr134 Level 1

            Thank you Bruce.

            Here is what we have done to clear all the existing markers in an asset

             

                                  var proj_item = rootElement[premiereAssetIndex];

                                       //to remove all the existing markers in the clip which were added last time when the asset is imported

                                       if (proj_item.type == ProjectItemType.CLIP ||proj_item.type == ProjectItemType.FILE)

                                       {

                                            var markersInAsset = proj_item.getMarkers();

                                            var existingMarkerList=[];

                                            for(var current_marker = markersInAsset.getFirstMarker();

                                            current_marker != undefined;

                                            current_marker = markersInAsset.getNextMarker(current_marker))

                                            {

                                                existingMarkerList.push(current_marker);//getting all the marker details in current asset for deleting                                     

                                            }

                                         }  

                                        for(var m=0;m<existingMarkerList.length;m++)

                                        {

                                                //deleting all existing markers

                                                markersInAsset.deleteMarker(existingMarkerList[m]);

                                        }

                                        //marker deletion code ends here