Create List of All Actions…

I have many actions in various action groups, and would love to be able to list all action names in a single Draft.

I often find it useful to group certain actions into promts using a Script and having the names of all available actions would be helpful in streamlining this process.

Is there a relatively straightforward way to do this?

The below snippet would build a list of all action names (not tested, but should be right):

let actionNames = [];
let groups = ActionGroup.getAll();
for (let group of groups) {
    for (let action of group.actions) {
        actionNames.push(action.name);
    }
}

// actionNames is now an array of all names

Is that all on need to work with?

3 Likes

That worked beautifully thank you!

let output = “# All Installed Actions\n\n”;
let groups = ActionGroup.getAll();
for (let group of groups) {
output += ## ${group.name}\n;

for (let action of group.actions) {
    if (!action.isSeparator) {
        output += `- ${action.name}\n`;
    }
}

output += "\n";

}

let d = Draft.create();
d.content = output;
d.update();
editor.load(d);