Does any one know how the HTMLTemplate action is accessible in a followed script action?
Or if it is not?
I know that I can use the script version of the HTMLTemplate and therefore replace the template action.
Just asking…
disclaimer
I am aware of the documentation.
I read it through and might have missed some important footnote.
Or a implicit note on the right side of my iPhone screen…
Do you mean the “Define Template Tag” action step, the “HTML Preview” action step, or something else?
There are lots of actions that could be related to “HTML Template”, but my guess is you are actually referring to an action step within a single action.
It is a great resource but does not state if the generated HTML can be retried from the HTMLPreview. The goal would be to get the result completely with template tags expanded.
This is only a minor issue though I would use the script like so:
scripting solution
expand template tags and preview HTML:
let html_template = "<html><body>[[title]]:<br/><br/>[[string]] <br/>[[ssst]] [[object]] </body></html><br>[[script]][[br]]let links = [[object]] [[/script]]"
let html = draft.processTemplate(html_template);
let preview = HTMLPreview.create();
if (preview.show(html)) {
// continue button was pressed
}
else {
// cancel button was pressed
}
You could do it with template tags as well, just remember they are strings. You are constructing an HTML string (with embedded JS, whatever), as long as your template tags output the correct script strings, they will work fine - but there’s no automatic conversion going on between types.