Automated Variable Import
Moderators: Alexander Halser, Tim Green
Automated Variable Import
I am generating variables using VBA script in Excel and exporting them as text files to be imported into H%M. I was wondering if there is any way to import the variables directly into H&M without having to use the Import feature.
-
- Posts: 202
- Joined: Mon Dec 28, 2015 7:32 pm
Re: Automated Variable Import
I always edit the project xml file directly. I need to change variables daily and unfortunately H+M does not update Variables when they change in the repository, so this is the only way
- Tim Green
- Site Admin
- Posts: 23181
- Joined: Mon Jun 24, 2002 9:11 am
- Location: Bruehl, Germany
- Contact:
Re: Automated Variable Import
Hi Dave,
As Tobias points out, Help & Manual does not currently use variables from the repository (but this feature may be added in a future version). However, if you can script the processing of a text file (the main .hmxp file is a plain text XML file) -- for example with a grep tool with command line support like PowerGrep or WinGrep -- you can automate the process of adding or modifying variables that way. You can find the variables down towards the end of the project file in the <variables> section. You can use your existing variables there as a model. The basic syntax of variable entries is:
The id= is the variable name, which must always be all upper case, no spaces or special characters allowed. the type= can be "text" or "html". The translate="true" means the variable is editable in Help & Manual. If you leave it out it is "protected".
As Tobias points out, Help & Manual does not currently use variables from the repository (but this feature may be added in a future version). However, if you can script the processing of a text file (the main .hmxp file is a plain text XML file) -- for example with a grep tool with command line support like PowerGrep or WinGrep -- you can automate the process of adding or modifying variables that way. You can find the variables down towards the end of the project file in the <variables> section. You can use your existing variables there as a model. The basic syntax of variable entries is:
Code: Select all
<variable id="VAR_NAME" type="text" translate="true">Variable Text</variable>
Regards,
Tim (EC Software Documentation & User Support)
Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
Tim (EC Software Documentation & User Support)
Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
Re: Automated Variable Import
Thanks for your help. I'll look into it.