Copy link to clipboard
Copied
Hi there,
I am going to move a lot of HTML files created with a different tool to RH 2022.2.22 (I might even be using the newest version, but thats the one that is currently running stable for my current projects).
Most of the cleanup can be accomplished using RegEx, but I am wondering if there is some Script already existing to remove all Inline Formatting spans? Or do I have to ask some js developer?
What I want to do achieve is to somehow automatize these steps: Open topic, select all, remove inline formatting.
The setting in the project options to not allow inline formatting does not seem to have any impact on imported html files.
Any ideas welcome!
Thanks
Karin
Copy link to clipboard
Copied
In theory if you select all the content in a topic, the Clear Formatting icon (T shape top right) on the Content Properties should do it.
I think the don't allow option is only when creating content, not existing topics with such styling.
Plan B will be copy and then paste back using CTRL SHIFT V. That removes all styling. It makes a mess of tables but you'll soon see it's not impossible to recover them. Also images will get lost. Perhaps call it Plan D. 🙂
________________________________________________________
My site www.grainge.org includes many free Authoring and RoboHelp resources that may be of help.
Copy link to clipboard
Copied
Clear formatting does exactly what I want. My problem is, that I have to open each file to do so. I would prefer this to be automated instead of manually opening several hundred files.
Copy link to clipboard
Copied
Sorry but I've nothing better to offer.
________________________________________________________
My site www.grainge.org includes many free Authoring and RoboHelp resources that may be of help.
Copy link to clipboard
Copied
Thanks anyway. It was worth a try 🙂
Copy link to clipboard
Copied
ExtendScript has File and Folder objects that let you loop through a folder of file and open each one. I am not sure if Clear Formatting is available in ExtendScript, but a regular expression could be applied. If you want me to look at this, please send me a before/after sample offlist. Thank you. rick at frameexpert dot com
Copy link to clipboard
Copied
Thank you Rick! Thats good to know. I'll talk to a developer colleague and try to get something scripted to clean up the files before importing them.
Thanks for your help!
Karin
Copy link to clipboard
Copied
Scripting was redone in RH New UI, so the ExtendScript that was available in Classic can't be used any more. I think you have to use javascript libraries like electron etc now, but it's not really documented anywhere. there's a RH 2019 scripting guide which is outdated and inadequate and doesn't mention the libraries that are available by default or what is necessary to use others, but if you want to have a look, it's available from the Appendix in the online help.