This here is the reason that I haven't pursued the Custom Prompt direction (yet) -- being able to activate the selected window is crucial to the workflow I'm trying to develop.
DanThomas, I haven't worked through your example well enough to actually follow it. Were you sending text to each of a bunch of Custom HTML Prompt windows? Was this part of answering Peter's open question of how to activate a selected window?
For a while I had been pursuing the idea that I might simply list all windows and filter for whatever titles followed my naming pattern of " Desktop Workspace Identifying Title" (DTWSID) where "X" will be the hotkey in the generated "Prompt With List" menu. See Activate (Focus) the First Window (Of Any App) That Contains “Search String”.
Algorithmically that seemed a very flexible direction, but when I found that AppleScript was taking two minutes to search for all the windows of all the open apps and list them, that was not a practical way to generate a Desktop Choice Menu.
I've also been looking at what it might take to actually create an AppleScriptable Swift app with XCode. My best lead on that so far has been Making Your Mac App’s Data Scriptable
which has a sample app in GitHub that demos adding and retrieving data from an XCode app -- making an app accessible from AppleScript requires creating a dictionary of AppleScript events that the app can respond to. In its simplicity, that article doesn't show how to get AppleScript to access a Swift function or a menu item. But it's a start. Last night I also found Making A Mac App Scriptable Tutorial which demos a window-based To-Do-List app. While more complicated, it may have more of what I need.
Just checking in...