Any workaround for plugins/commands hotkeys?

Thanks! While writing the topic I had an assumption that psjs scripts can be added to File > Scripts menu (or any other menu?) but it seems that I was wrong… I guess for the “”“security”“” reasons you can only call them by dropping the scripts into the app, using inside Actions or by using the File > Scripts > Browse menu which makes them useless. I don’t understand this design decision at all. So unfortunately I believe .jsx are the only plausible way of using hotkeys outside or Actions hotkeys restricted to F-keys.

I’m also digging the recorded actions option, following this topic: Action calling UXP plugin functionality example - #2 by sttk3. For example on the panel you can have

window.myFunction = async () => { console.log("triggered ) };

and in JSX you have

  var desc1 = new ActionDescriptor();
  desc1.putString(stringIDToTypeID("pluginID"), "com.panel.id"); // panel ID goes here
  desc1.putString(stringIDToTypeID("pluginName"), "Panel Name"); // panel Name goes here
  desc1.putString(charIDToTypeID('Ttl '), "Action Title"); // A title for modal
  desc1.putString(stringIDToTypeID("methodName"), "myFunction"); // name of the function to be executed on the panel;
  var desc2 = new ActionDescriptor();
  desc1.putBoolean(stringIDToTypeID("useLoader"), true);
  var ref1 = new ActionReference();
  ref1.putEnumerated(charIDToTypeID('capp'), charIDToTypeID('Ordn'), charIDToTypeID('Trgt'));
  desc1.putReference(charIDToTypeID('null'), ref1);
  executeAction(stringIDToTypeID('scriptAction'), desc1, DialogModes.NO);

that will trigger the myFunction() on the panel. Unfortunately it seems that most of async functions inside this top level function lock Photoshop with a modal popup. For example I can read a text file without problems within this function but calling a batchplay shows the never ending modal popup. It could be that the function should be wrapped in some obscure executeContext callback or another UXP bullshit… haven’t figured it out yet.