Scripting Access to Information About Actions

A little meta perhaps, but I think it might be quite useful to access to information about actions from a script action.

My initial example would be if I am going to call another action I could check if it exists first. If it doesn’t I could prompt the user to download it from the Action Directory and optionall offer to open a link to the download page.

I’m sure there are other useful things that could be done with other data about action items too. Things like being able to generate a lits of all items in all groups, how many steps they have, etc. might be quite fun. Being able to query for how many times an action has been run could also be interesting meta data about how I’m using Drafts.

It’s pretty limited now, but you can query for an action.

Action scripting docs

var action = Action.find("My Action Name");

It will return undefined if the action is not found.

That would allow your first example to be implemented. Primary use-case for it being there now is to use with app.queueAction(action, draft) to fire another action from script based on conditions.

1 Like

This would be really helpful for me. I’d love to be able to get the Action Log. Here’s the scenario – given a draft with content X:

in Drafts: action to search site 1 for content X
in Safari: share results to Drafts (create without opening)
in Drafts: action to search site 2 for content X
in Safari: share results to Drafts (ditto)
then back at the original draft with content X, run an action that creates a log in the text itself