# Perspective Script Transforms to Text

**URL:** <https://forum.inductiveautomation.com/t/perspective-script-transforms-to-text/58026>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [April 5, 2022, 3:25am UTC](https://forum.inductiveautomation.com/t/perspective-script-transforms-to-text/58026 "2022-04-05T03:25:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kgamble](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kgamble/32/8019_2.png) [@kgamble](https://forum.inductiveautomation.com/u/kgamble)\
**Post date:** [April 5, 2022, 3:25am UTC](https://forum.inductiveautomation.com/t/perspective-script-transforms-to-text/58026/1 "2022-04-05T03:25:39Z")

</div>

For doing a diff between two branches of perspective views, its a bit difficult to review two conflicting script transforms based off the html safe encoding being used.

Is there a relatively easy way to convert this back into a human readable format?

I have tried a few encoders/decoders and no luck. Is there a specific format I should be looking for a converter for? Or is the answer for me to be un-lazy and just write the code to convert it myself? lol

Thanks for any help!

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [April 5, 2022, 7:24am UTC](https://forum.inductiveautomation.com/t/perspective-script-transforms-to-text/58026/2 "2022-04-05T07:24:14Z")

</div>

Seems unlikely you can format specific things in a json file without coding atleast something xd

i have a code somewhere that pulls out texts out of the view.jsons, im sure it can be altered to pull out scripts too which you then should be able to format i suppose. Tho it doesnt give file location with it, so you will have to alter the code a bit for that

> [@Export all component text used in Ignition](https://forum.inductiveautomation.com/t/export-all-component-text-used-in-ignition/53668/4):
>
> Here is a script i used to automatically add all text values to the translate manager in perspective By checking the resource files… warning this may take a while xd import os import json from com.inductiveautomation.ignition.gateway import IgnitionGateway from com.inductiveautomation.ignition.gateway.script import GatewaySystemUtilities package = IgnitionGateway.get().getLocalizationManager().loadFullPackage() oldKeys = package.getAvailableKeys() context = IgnitionGateway.get() path…

you might also want to look at this

> [@How to create / append bulk tooltips via script with json export?](https://forum.inductiveautomation.com/t/how-to-create-append-bulk-tooltips-via-script-with-json-export/50072/4):
>
> You can do it with jq (a downloadable command-line executable designed to manipulate JSON): walk( if type == "object" and .valueSource == "opc" then .tooltip = "TagName: \(.name) \(.opcItemPath)" else . end) [https://jqplay.org/s/Pe6T7qNEFY](https://jqplay.org/s/Pe6T7qNEFY) I mostly copied this snippet from here:

---

<div class="post-metadata">

**Author:** ![kgamble](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kgamble/32/8019_2.png) [@kgamble](https://forum.inductiveautomation.com/u/kgamble)\
**Post date:** [April 5, 2022, 5:32pm UTC](https://forum.inductiveautomation.com/t/perspective-script-transforms-to-text/58026/3 "2022-04-05T17:32:41Z")

</div>

> [@victordcq](#):
>
> Seems unlikely you can format specific things in a json file without coding atleast something xd

Yeah I just didnt know if they were using a common encoding mechanism that could be boiled down to a specific format, or if its a custom encoded text format. If its a common one than it would probably have a specific function I could write, as opposed to replacing all special characters

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [April 5, 2022, 5:52pm UTC](https://forum.inductiveautomation.com/t/perspective-script-transforms-to-text/58026/4 "2022-04-05T17:52:11Z")

</div>

We need to turn off the escaping on our side (it’s superfluous) but if you want to reverse it yourself it’s pretty simplistic; it’s a straightforward substitution of a few characters:

> <https://github.com/google/gson/blob/73216b2ad7b16f669000b8d7bb443921ea1a5b55/gson/src/main/java/com/google/gson/stream/JsonWriter.java#L143>
