Hello,
As you mentioned, the current action only works on selection. What you need is another
custom action, of a different type, that allows for the AI to analyze all images, not only the selected one. This type is called "update-entire-document-based-on-images" (available in the content completion window for the "type" property).
Here is an example of such an action:
Code: Select all
{
"id": "generate.img.alternate.text.all",
"title": "Generate Alternate Text for All Images",
"categoryId": "Accessibility",
"type": "update-entire-document-based-on-images",
"framework": "*DITA*",
"input-type": "markup",
"description": "Generate alternate text for all images.",
"context": "Generate alternate text for all images in the given content and for each of them add the generated text in an <alt> element (not the attribute), which in turn is added as a child of the corresponding <image> element.",
"parameters": {
"engine": {"name": "gpt-4o-2024-11-20"}
}
}
Please note that the instructions (see the "context" property") are not perfect. I wrote them in a 1 minute or so, for demo purposes.
You can then use this action with "AI Positron XML Refactoring" to perform it on a collection of files.
By the way, I also create issue OPA-3058 to perhaps add this functionality (an action that works on all images in a document) by default in Oxygen.
Alternatively, you can use the same instructions from the "context" property in the "AI Positron XML Refactoring" dialog box, in the "Custom instructions" text area. But I personally prefer actions, at least because they are easier to use.
In regards to the prompts we use for our actions, they are not for sharing

.
All the best wishes,
Sorin Carbunaru
Oxygen XML Editor