I am writing interactive stories for e-learning applications where scenes are often cut up into interactive segments and build in an e-learning engine. It would be really helpful to have a piece of software which allows me to write and present a script document in a traditional format, but allows me to add data to the text, things like tags/IDs to titles, paragraphs or chapters, so that I can programmatically use the script to generate actions. For example, if I could add a "Voiceover" ID to every voiceover in the story, and then run a python script to use an AI generator to output a voice over for each Voiceover ID text. Any thoughts on a suitable word processing application with such capability?
You could try using https://obsidian.md/ for your task. It has things like callouts, block-ids and tags for your exact purpose. You can create blocks of your text, have block ids and a separate note listing the block-id and action.