Skip to main content
Participating Frequently
August 25, 2023
Answered

PPro Panel - "Detect cuts in active sequence" not working

  • August 25, 2023
  • 2 replies
  • 540 views

Nothing happens when you click on the button  "Detect cuts in active sequence" - No UpdateEventPanel update either. Is this functionality broken?

This topic has been closed for replies.
Correct answer Bruce Bullis

Just a typo. 🙂 This works:

var activeSeq = app.project.activeSequence;
if (activeSeq) {
	var sel = activeSeq.getSelection();
	if (sel[0]) {
		var action 							= 'ApplyCuts';	//'ApplyCuts', 'CreateMarkers'
		var shouldApplyCutsToLinkedAudio	= true;
		var sensitivity 					= 'LowSensitivity'; //'LowSensitivity', 'MediumSensitivity', 'HighSensitivity'
		var result = activeSeq.performSceneEditDetectionOnSelection(action, shouldApplyCutsToLinkedAudio, sensitivity);
	} else {
		alert("performSceneEditDetectionOnSelection: Nothing selected, in sequence.");
	}
} else {
	alert("performSceneEditDetectionOnSelection: No active sequence.");
}

2 replies

MyerPj
Community Expert
Community Expert
August 25, 2023

There are other reasons also to get off 23.4, update to 23.6.

CACUserAuthor
Participating Frequently
August 30, 2023

@Bruce Bullis In your reply above you have

 

var sel = activeSeq.getSelection();
if (sel[0]) {

--------

}

Firstly I dont find this method (getSelection()) listed under Sequence Object. Also is there a corresponding setSelection method? Sometimes getSelection is returning null, so maybe I should set it before getting the selection

 

Bruce Bullis
Community Manager
Community Manager
August 30, 2023

Typically, scripts operate on the user's current selection.  

sequence.setSelection() takes an array of trackItems; I'll look for some example usage.

Here's example usage of getSelection(), in PProPanel: https://github.com/Adobe-CEP/Samples/blob/e60d6a22ef44d8eb4cca3904c35a0c050576b697/PProPanel/jsx/PPRO/Premiere.jsx#L2078

Here's how to get/set selection, for individual trackItems: https://github.com/Adobe-CEP/Samples/blob/e60d6a22ef44d8eb4cca3904c35a0c050576b697/PProPanel/jsx/PPRO/Premiere.jsx#L1317


Bruce Bullis
Community Manager
Bruce BullisCommunity ManagerCorrect answer
Community Manager
August 25, 2023

Just a typo. 🙂 This works:

var activeSeq = app.project.activeSequence;
if (activeSeq) {
	var sel = activeSeq.getSelection();
	if (sel[0]) {
		var action 							= 'ApplyCuts';	//'ApplyCuts', 'CreateMarkers'
		var shouldApplyCutsToLinkedAudio	= true;
		var sensitivity 					= 'LowSensitivity'; //'LowSensitivity', 'MediumSensitivity', 'HighSensitivity'
		var result = activeSeq.performSceneEditDetectionOnSelection(action, shouldApplyCutsToLinkedAudio, sensitivity);
	} else {
		alert("performSceneEditDetectionOnSelection: Nothing selected, in sequence.");
	}
} else {
	alert("performSceneEditDetectionOnSelection: No active sequence.");
}
CACUserAuthor
Participating Frequently
August 25, 2023

Using the above code - nothing happens. I am using ver 23.4.0 - Premeire Pro.

No error is thrown and no alert boxes are shown. Is this performing the functionality of the following menu item? right click on Sequence and select "Scene Edit Detection..."? Just verifying if this is the functionality of the  performSceneEditDetectionOnSelection function in ExtendScript?

Bruce Bullis
Community Manager
Community Manager
August 25, 2023

I have confirmed that the code provided works correctly in 23.6 (and the API hasn't changed since its introduction).

The snippet is designed to do nothing, if no trackItems are selected; did you step through it in a debugger? Perhaps try again, with some trackItems selected...?