Page 1 of 1
actions on file create from template
Posted: Sat Jan 20, 2018 1:19 am
by steve.cuzner
Is there a way to cause a custom action to execute after a new document is created from a template (file->New)? I would like to execute the docbook generate.ids action to execute so that a new document has all IDs populated.
Re: actions on file create from template
Posted: Mon Jan 22, 2018 10:16 am
by Radu
Hi Steve,
If you look at how the XML looks like for a DITA new file template:
OXYGEN_INSTALL_DIR\frameworks\dita\templates\topic\Topic.dita
it uses the Oxygen
${id} editor variable. All editor variables in new file templates are automatically expanded when the template is used to create a new file.
All editor variables are listed here:
https://www.oxygenxml.com/doc/versions/ ... ables.html
If you need more complex stuff, there is a GitHub sample plugin which executes Author actions to change the document before the document is saved:
https://github.com/oxygenxml/ExecuteAut ... OnSaveHook
Regards,
Radu