I use a GUI to create my page, it is saved as a JSON file, then the JSON file is read by a CMS.
The problem: I would like to tinker with the objects I created, but the code is super minimized, an I cannot find the object.
To be clear with an example. I create a page with a button named "BUTTON". It exports in a JSON like this:
"S":[
{
"Y":"h",
"b":1,
"nm":"BUTTON1",
"f":"1,0,1,0",
"c":"FFFFFF,000000",
"l":"2020,1840,4140,8820",
"n":"Helvetica",
"h":192,
"L":0,
"i":0,
"j":1,
"vj":1,
"t":"Button",
"Act":[
{
"e":"OnClick",
"s":"\r\ngraphicReplace(\"Public/essai/vue0\");"
}
]
}
]
And it displays a button in the CMS. But, if I try something like "alert(S.t);", I get a "ReferenceError: S is not defined".
What I would like to do, is find a way to say: Find me the object, for which one of the properties is equal to "Button". Give me is name.
So that I can, using JS, change its position, size, and so on.
Full JSON
{
"PG":{
"v":5,
"h":20480,
"w":25600,
"pc":"FFFFFF",
"de":"",
"st":0,
"Act":[
],
"S":[
{
"Y":"h",
"b":1,
"nm":"BUTTON1",
"f":"1,0,1,0",
"c":"FFFFFF,000000",
"l":"2020,1840,4140,8820",
"n":"Helvetica",
"h":192,
"L":0,
"i":0,
"j":1,
"vj":1,
"t":"Button",
"Act":[
{
"e":"OnClick",
"s":"\r\ngraphicReplace(\"Public/essai/vue0\");"
}
]
}
]
} }
S[0].t.