Quantcast
Channel: Adobe Community : Popular Discussions - Photoshop Scripting
Viewing all articles
Browse latest Browse all 12244

How can I find the target/result of a photoshop event?

$
0
0

Hi all,

 

Is there a method of retrieving information about the results of a Photoshop event? For example, after a Delete event ("Dlt ") can I get any information on what was deleted?

Specifically my current needs are to find what layer was deleted after a delete event.

 

The relevant js code in my project is:

 

function registerPSEvent( typeIDs, clear ){  // unregisters an even before adding it - prevents double events  var regUnreg = null;  if( clear ){  console.log( 'Unregistering ' + typeIDs );  regUnreg = 'PhotoshopUnRegisterEvent';  } else {  console.log( 'Registering ' + typeIDs );  regUnreg = 'PhotoshopRegisterEvent';  }  var e = new CSEvent(  'com.adobe.' + regUnreg,  'APPLICATION',  csInterface.getApplicationID(),  csInterface.getExtensionID()  );  e.data = typeIDs;  csInterface.dispatchEvent(e);
}

// s2t is simply an abbreviation of stringIDToTypeID
function addPSEventListener( typeStrings, callback, target ) {
  csInterface.evalScript( "s2t('"+typeStrings+"')", function(r){  registerPSEvent( r, true );  registerPSEvent( r );  csInterface.addEventListener( 'PhotoshopCallback', callback.bind(target) );  } );
}

addPSEventListener( 'delete', delLayerEventHandler, this );

delLayerEventHandler = function(e) {
  console.log(e);  // here i would like to be able to get what was deleted
}

 

Thanks,

 

Tom


Viewing all articles
Browse latest Browse all 12244

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>