It is working with blank drafts because for the majority of users, particularly users of previous versions, when they open Drafts, they get a new Draft each time. I don’t personally have mine configured like that, but if that’s typical behaviour, then I can understand why that is the case for Siri … and why there’s a specific note about it in the Siri set-up. I don’t think you’re missing anything fundamental. I think you’ve understood the situation perfectly, but just any potential reason as to why seems to have been the issue.
For reference on the above, take a look in your settings for the New Draft Creation section at the top and in particular the New Draft After and Focus mode settings.
But, all is not lost
I’ve had a quick go at putting together an alternative Captain’s Log action. Instead of using the File action it uses a Script action to accomplish the same sort of thing, but with a bit more besides.
The key assumption here is that the last draft you modified is the one that you want to append details for to the log. Based on this assumption, the script first identifies the last modified draft. It loads it into the editor. This is hopefully quick enough that you won’t even notice a blank draft was there initially. The second part of the script then builds the log file.
Below is what the script looks like. Hopefully you can make sense of the key elements I replicated from your initial action.
//Load the last modified draft
let allDrafts = Draft.query("", "all", );
allDrafts = allDrafts.sort(function(draftA, draftB)
return draftB.modifiedAt - draftA.modifiedAt
//Get the current log content
let fmCloud = FileManager.createCloud();
let strLogPath = "/Logs/Log-" + draft.processTemplate("[[date|%Y-%m]]") + ".txt";
let strLogContent = fmCloud.read(strLogPath);
//Append the new log content to the existing content
strLogContent += draft.processTemplate("[[date]]");
strLogContent += " ";
strLogContent += draft.processTemplate("[[time|%R]]");
strLogContent += " ";
strLogContent += draft.processTemplate("[[tags]]");
strLogContent += " : ";
strLogContent += allDrafts.content;
strLogContent += "\n";
//Write the revised content back to the log file
I did try to queue up the original action at first after loading the last modified draft, but even after loading that draft, the ‘draft context’ the queued action took was the original blank draft. Hence why I reproduced the file action in the script.
In my tests, this worked just fine when run from the actions list and from a Siri command. Hope it works for you too, but let me know if it has any issues.