• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

addEventListener for Adding Markers in Sequence?

Explorer ,
Feb 03, 2020 Feb 03, 2020

Copy link to clipboard

Copied

Does anyone know the specific event to listen for when new comment markers are added to the active sequence?

For example...

csInterface.addEventListener("com.adobe.csxs.events.newMarkerCreated", function(event){
//...
});

Moreover, is there any documentation on all the events we can listen for when adding event listeners in Premiere Pro? I've searched the sample code and CEP documentation and found a few so far... but was wondering if there were more.

TOPICS
SDK

Views

1.4K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 3 Correct answers

Adobe Employee , Feb 04, 2020 Feb 04, 2020

> Does anyone know the specific event to listen for when new comment markers are added to the active sequence?

 

There is no such message. You're right, there is no "messages" documentation; we'll exercise a couple more of these, in the next release of PProPanel.

 

- onSourceClipSelectedInProjectPanel
- onSequenceActivated
- onActiveSequenceChanged
- onActiveSequenceSelectionChanged
- onActiveSequenceTrackItemAdded
- onActiveSequenceTrackItemRemoved
- onActiveSequenceStructureChanged
- onProjectChanged

...

Votes

Translate

Translate
Adobe Employee , Dec 18, 2023 Dec 18, 2023

To be notified of changes to the active sequence, register for onActiveSequenceStructureChanged messages, not onSequenceActivated. 

The event 'onSequenceActivated' can only interact with the elements in the jsx script


I'm not sure what distinction you're making; ExtendScript interacts with ExtendScript.

 

If you'd like to send a message from ExtendScript to your panel's JavaScript layer, use CSXS messages, as demostrated in PProPanel; search for "com.adobe.csxs.events.PProPanelRenderEvent".

Votes

Translate

Translate
Community Beginner , Feb 09, 2024 Feb 09, 2024

OMG! I got it. Thank you very much Bruce, without you I would still be blind.

So for everyone else same as me (not the sharpest pencil in the box):

HTML <script> (JS) part:

var csInterface = new CSInterface();
			csInterface.addEventListener('com.adobe.csxs.events.myActiveSequenceSelectionChanged', function(event) {
				// alert("gogo");
				document.getElementById('seq_name').innerHTML = event.data;

and Extend script:
1) you need 2 files in your jsx folder: JavaScript.d.ts and PlugPlugExternalObject

...

Votes

Translate

Translate
Adobe Employee ,
Feb 04, 2020 Feb 04, 2020

Copy link to clipboard

Copied

> Does anyone know the specific event to listen for when new comment markers are added to the active sequence?

 

There is no such message. You're right, there is no "messages" documentation; we'll exercise a couple more of these, in the next release of PProPanel.

 

- onSourceClipSelectedInProjectPanel
- onSequenceActivated
- onActiveSequenceChanged
- onActiveSequenceSelectionChanged
- onActiveSequenceTrackItemAdded
- onActiveSequenceTrackItemRemoved
- onActiveSequenceStructureChanged
- onProjectChanged
- onProjectEndDrop
- onEncoderJobCanceled
- onEncoderJobQueued
- onEncoderJobComplete
- onEncoderJobError
- onEncoderJobProgress
- onEncoderLaunched

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Dec 07, 2023 Dec 07, 2023

Copy link to clipboard

Copied

Hey Bruce! Can you give me a brief example of how I could set up an event listener in CEP for onActiveSequenceChanged?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Dec 07, 2023 Dec 07, 2023

Copy link to clipboard

Copied

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Dec 18, 2023 Dec 18, 2023

Copy link to clipboard

Copied

Hello Bruce,

How can we listen for the sequence change and pass the active sequence name in our CEP Panel without polling? The event 'onSequenceActivated' can only interact with the elements in the jsx script. I want to make it so it will return the sequence name once the event is triggered and pass it to my javascript so that my CEP Panel will automatically change 'tabs' depends on the sequence name. 

I tried binding the event in the app (just like in PProPanel) and return the sequence name instead of updating the event panel. The problem is the evalscript only ran one time so I can't do what I want except if I use polling.



Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Dec 18, 2023 Dec 18, 2023

Copy link to clipboard

Copied

To be notified of changes to the active sequence, register for onActiveSequenceStructureChanged messages, not onSequenceActivated. 

The event 'onSequenceActivated' can only interact with the elements in the jsx script


I'm not sure what distinction you're making; ExtendScript interacts with ExtendScript.

 

If you'd like to send a message from ExtendScript to your panel's JavaScript layer, use CSXS messages, as demostrated in PProPanel; search for "com.adobe.csxs.events.PProPanelRenderEvent".

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Feb 08, 2024 Feb 08, 2024

Copy link to clipboard

Copied

Hello Bruce,

may I ask how exactly? Because code: 

csInterface.addEventListener('com.adobe.csxs.events.WorkspaceChanged', function(event) {
				alert("gogo");
				document.getElementById('seq_name').innerHTML = "goggo";
			
			});

is not working. Nieder :

csInterface.addEventListener('com.adobe.csxs.events.WorkspaceChanged', function(event) {
				alert("gogo");
				document.getElementById('seq_name').innerHTML = "goggo";			
csInterface.evalScript('$.runScript.registerSequenceSelectionChangedFxn()', function(result) {
document.getElementById('seq_name').innerHTML = result;
});
});




Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Feb 08, 2024 Feb 08, 2024

Copy link to clipboard

Copied

Screenshot 2024-02-08 at 1.24.39 PM.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Works here; why would you only register your sequence changed function, after someone changes the workspace?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Feb 09, 2024 Feb 09, 2024

Copy link to clipboard

Copied

Well, my goal is to trigger the "onActiveSequenceSelectionChanged " event and if something in the premiere pro is changed (selection, clip is moved) the alert, or message appears in the CEP panel. I followed beforementioned posts but without success.

Maybe My understanding of the problem is lame - if so - sorry about that, but I didn't fully understand the relationship between CSXS messages and app.bind events. May I ask you for a little push on the issue I am trying to solve? 

registerSequenceSelectionChangedFxn : function () {
		var success = app.bind('onActiveSequenceSelectionChanged', $.runScript.myActiveSequenceSelectionChangedFxn);
	}

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Feb 09, 2024 Feb 09, 2024

Copy link to clipboard

Copied

> May I ask you for a little push on the issue I am trying to solve? 

Sure!
First step: Set a breakpoint here in PProPanel, and confirm that you hit this function when changing the sequence selection?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Feb 09, 2024 Feb 09, 2024

Copy link to clipboard

Copied

Confirmed,

The extend script part is functional and it gives me the event in the event panel in premiere pro trough the function: 

updateEventAPI: function (string){
		app.setSDKEventMessage(string,"info")
	},

Spawn_x_0-1707500377536.png

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Feb 09, 2024 Feb 09, 2024

Copy link to clipboard

Copied

Cool, now replace that info event, with your awesome code. 🙂

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Feb 09, 2024 Feb 09, 2024

Copy link to clipboard

Copied

Well, first thing first - I think it is your awesome code if you did ppropanel - thank you for that. I am only a humble struggling scripter.
And second - Replacing code -
Em you mean -  

myActiveSequenceSelectionChangedFxn : function () {
		a = "jedu";
		$.runScript.updateEventAPI(a);
		// return a;
	},

This one ... for what exactly? Something with "com.adobe.csxs.events.WorkspaceChanged" ? Or In html(JS) part 
something like: 

var csInterface = new CSInterface();
			csInterface.addEventListener('com.adobe.csxs.events.WorkspaceChanged', function(event) {
alert("gogo");
document.getElementById('seq_name').innerHTML = "goggo";                                csInterface.evalScript('$.runScript.registerSequenceSelectionChangedFxn()', function(result) {
document.getElementById('seq_name').innerHTML = result;            
});
});

Because on that part i am strugling for 2 days.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Feb 09, 2024 Feb 09, 2024

Copy link to clipboard

Copied

Above, you're registering for a message about changes to the PPro workspace in use. 

In your writing, you talk about wanting to respond when the sequence selection changes. 

PProPanel successfully responds to sequence selection changes. Beyond that, you'd like to get a message from your ExtendScript, to your JavaScript, right? 

To do so, your ExtendScript would post a custom CSXS event (instead of com.adobe.csxs.events.WorkspaceChanged, com.whatever.message.name.you.like...), and register a listener for that message, in your JavaScript. 

Search PProPanel for 'com.adobe.csxs.events.PProPanelRenderEvent'.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Feb 09, 2024 Feb 09, 2024

Copy link to clipboard

Copied

LATEST

OMG! I got it. Thank you very much Bruce, without you I would still be blind.

So for everyone else same as me (not the sharpest pencil in the box):

HTML <script> (JS) part:

var csInterface = new CSInterface();
			csInterface.addEventListener('com.adobe.csxs.events.myActiveSequenceSelectionChanged', function(event) {
				// alert("gogo");
				document.getElementById('seq_name').innerHTML = event.data;

and Extend script:
1) you need 2 files in your jsx folder: JavaScript.d.ts and PlugPlugExternalObject.d.ts
2) you need all of this code - which means the register of custom CSXS event:

var eoName = "";
		if (Folder.fs === 'Macintosh') {
			eoName = "PlugPlugExternalObject";
		} else {
			eoName = "PlugPlugExternalObject.dll";
		}		
		var plugplugLibrary = new ExternalObject( "lib:" + eoName );
		if (plugplugLibrary){
			var eventObj	= new CSXSEvent();
			eventObj.type	= "com.adobe.csxs.events.myActiveSequenceSelectionChanged";
			eventObj.data	= "funguju  macejko";
			eventObj.dispatch();
		};

 

then and after then only, the mission is completed 🙂 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 04, 2020 Feb 04, 2020

Copy link to clipboard

Copied

Bummer. We would've really liked to change the color of a marker, depending on a keyword detected in the name field. 
Either way, thanks for your quick response, Bruce. And for this shortlist of messages in Premiere.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Feb 04, 2020 Feb 04, 2020

Copy link to clipboard

Copied

Well, it wouldn't be automatic, but a "update marker colors based on keywords" button would still work. 🙂

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 04, 2020 Feb 04, 2020

Copy link to clipboard

Copied

Indeed! We build the logic for it and have a button in our panel to run the script.

We were just hoping to leverage events so the colors could change on the fly, without user interaction. 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines