Extended Export Script Capabilities

The export script is nice and with some coding can do a number of interesting things but by their nature the scripts tend to be platform specific. I find the majority of what I need to do could be accomplished by being able to add multiple search/replace instructions to the export process.

For example when embedding Angular directives the property names do not seem to be considered valid, I can however use a recognizable placeholder then during the export replace them with the desired value.

I'd imagine a dialog in the export window to build as many "replace commands" as necessary possibly supporting a basic text "find this replace with that" or a Regular Expression-based replacement that would I think add tremendous capabilities without a great deal of work.

As an example (and should it be useful to others) I am using PowerShell search and replace to allow me to embed Angular directives in BootStrap Studio. The directive our developers tell me we need looks like this in raw HTML:

<input type="text" [(ngModel)]="model.install_date" formControlName="install_date" value="4/29/18" placeholder="Field Four Placeholder" id="field4">

The key attribute is "[(ngModel)]="model.install_date", I can add an attribute in BSS but it will not allow the surrounding [{ }] therefore I am testing using an alternate of ang-ngModel-ang as the attribute name and "model.install_date" as the value. On export I have added a Windows CMD file that contains this PowerShell command:

@REM Regular Expression Search and Replacement
powershell -Command "(gc %1) -replace '(?<prefix>ang\-)(?<token>ngmodel|ngtest)(?<suffix>\-ang)', '[(${token})]' | Out-File %1"

This takes the file exported by BSS (%1) and does a Regular Expression search and replace, basically changes this:

<input type="text" ang-ngModel-ang-="model.install_date" formControlName="install_date" value="4/29/18" placeholder="Field Four Placeholder" id="field4">

to this:

<input type="text" [(ngModel)]="model.install_date" formControlName="install_date" value="4/29/18" placeholder="Field Four Placeholder" id="field4">

There by creating an "Angular Ready" file directly from BSS - and more importantly allowing us to continue using BSS to edit/update the file over time.

Any number of similar search/replace commands can be added either as combined regular expressions or with multiple calls, the output file name can also be modified should you need for example a PHP file.