Add only actions from the respective set to the list

Hi @Jarda, man I tried to follow the links you indicated, but it left my head with bugs, I’m not at that level of understanding such complex code. I tried something with the codes at the end of this link however, I was not successful.
I ended up finding the solution in this other post:Execute a script via a button - #8 by ddbell
The result was quite satisfactory:

const getActionSet = require('photoshop').app.actionTree;
const ActionSet = document.getElementById("list_AS")
const AcrionList = document.getElementById("list_AC")

for (let i=0; i<getActionSet.length; i++){
     ActionSet.insertAdjacentHTML("beforeend", `<sp-menu-item>${getActionSet[i].name}</sp-menu-item>`); 
}

ActionSet.addEventListener("change", evt => {
    AcrionList.innerHTML ="";
    for (let i=0; i<getActionSet.length; i++){ var getActionItens = getActionSet[evt.target.selectedIndex]}
    for (let i=0; i<getActionItens.actions.length; i++){
         AcrionList.insertAdjacentHTML("beforeend", `<sp-menu-item>${getActionItens.actions[i].name}</sp-menu-item>`); 
         AcrionList.selectedIndex = 0;
    }
})

document.querySelector("#btnRun").addEventListener("click",  evt => {
    core.executeAsModal( async() => {
      const list_AS = ActionSet.value; list_AC = AcrionList.value;
      await app.batchPlay([{"_obj":"play","_target":[{"_name": list_AC,"_ref":"action"},{"_name": list_AS,"_ref":"actionSet"}]}], { });
    })
})

Here I share the 100% working plugin, maybe someone might find this useful.
ACTIONS-LIST_PS.ccx (6.7 KB)

2 Likes