when running the code the output is always null and includes the newline opperator \n. what i wrong here
raw json thing :
{"is-c3-clipboard-data":true,"type":"events","items":[{"eventType":"group","disabled":false,"title":"get sys info","description":"","isActiveOnStart":true,"children":[{"eventType":"variable","name":"index","type":"number","initialValue":"0","comment":"","isStatic":true,"isConstant":false},{"eventType":"variable","name":"e","type":"string","initialValue":"\"\"","comment":"","isStatic":false,"isConstant":false},{"eventType":"variable","name":"text","type":"string","initialValue":"\"\"","comment":"","isStatic":true,"isConstant":false},{"functionName":"get sys info","functionDescription":"","functionCategory":"","functionReturnType":"none","functionCopyPicked":false,"functionIsAsync":false,"functionParameters":[],"eventType":"function-block","conditions":[],"actions":[{"id":"add-key","objectClass":"Dictionary","parameters":{"key":"\"Canvas css height\"","value":"PlatformInfo.CanvasCssHeight"}},{"id":"add-key","objectClass":"Dictionary","parameters":{"key":"\"canvas css width\"","value":"PlatformInfo.CanvasCssWidth"}},{"id":"add-key","objectClass":"Dictionary","parameters":{"key":"\"canvas device height\"","value":"PlatformInfo.CanvasDeviceHeight"}},{"id":"add-key","objectClass":"Dictionary","parameters":{"key":"\"canvas device width\"","value":"PlatformInfo.CanvasDeviceWidth"}},{"id":"add-key","objectClass":"Dictionary","parameters":{"key":"\"connection effective type\"","value":"PlatformInfo.ConnectionEffectiveType"}},{"id":"add-key","objectClass":"Dictionary","parameters":{"key":"\"conection rtt\"","value":"PlatformInfo.ConnectionRTT"}},{"id":"add-key","objectClass":"Dictionary","parameters":{"key":"\"connection type\"","value":"PlatformInfo.ConnectionType"}},{"id":"add-key","objectClass":"Dictionary","parameters":{"key":"\"Device memory\"","value":"PlatformInfo.DeviceMemory"}},{"id":"add-key","objectClass":"Dictionary","parameters":{"key":"\"Device pixel ratio\"","value":"PlatformInfo.DevicePixelRatio"}},{"id":"add-key","objectClass":"Dictionary","parameters":{"key":"\"Downlink\"","value":"PlatformInfo.Downlink"}},{"id":"add-key","objectClass":"Dictionary","parameters":{"key":"\"Downlink max\"","value":"PlatformInfo.DownlinkMax"}},{"id":"add-key","objectClass":"Dictionary","parameters":{"key":"\"FPS\"","value":"PlatformInfo.FramesPerSecond"}},{"id":"add-key","objectClass":"Dictionary","parameters":{"key":"\"Hardware concurrency\"","value":"PlatformInfo.HardwareConcurrency"}},{"id":"add-key","objectClass":"Dictionary","parameters":{"key":"\"Renderer\"","value":"PlatformInfo.Renderer"}},{"id":"add-key","objectClass":"Dictionary","parameters":{"key":"\"Renderer detail\"","value":"PlatformInfo.RendererDetail"}},{"id":"add-key","objectClass":"Dictionary","parameters":{"key":"\"SafeAreaInsetBottom\"","value":"PlatformInfo.SafeAreaInsetBottom"}},{"id":"add-key","objectClass":"Dictionary","parameters":{"key":"\"SafeAreaInsetLeft\"","value":"PlatformInfo.SafeAreaInsetLeft"}},{"id":"add-key","objectClass":"Dictionary","parameters":{"key":"\"SafeAreaInsetRight\"","value":"PlatformInfo.SafeAreaInsetRight"}},{"id":"add-key","objectClass":"Dictionary","parameters":{"key":"\"SafeAreaInsetTop\"","value":"PlatformInfo.SafeAreaInsetTop"}},{"id":"add-key","objectClass":"Dictionary","parameters":{"key":"\"Screen height\"","value":"PlatformInfo.ScreenHeight"}},{"id":"add-key","objectClass":"Dictionary","parameters":{"key":"\"screen width\"","value":"PlatformInfo.ScreenWidth"}},{"id":"add-key","objectClass":"Dictionary","parameters":{"key":"\"TicksPerSecond\"","value":"PlatformInfo.TicksPerSecond"}},{"id":"add-key","objectClass":"Dictionary","parameters":{"key":"\"WindowInnerHeight\"","value":"PlatformInfo.WindowInnerHeight"}},{"id":"add-key","objectClass":"Dictionary","parameters":{"key":"\"WindowInnerWidth\"","value":"PlatformInfo.WindowInnerWidth"}},{"id":"add-key","objectClass":"Dictionary","parameters":{"key":"\"WindowOuterHeight\"","value":"PlatformInfo.WindowOuterHeight "}},{"id":"add-key","objectClass":"Dictionary","parameters":{"key":"\"WindowOuterWidth\"","value":"PlatformInfo.WindowOuterWidth "}}]},{"eventType":"block","conditions":[{"id":"on-start-of-layout","objectClass":"System"}],"actions":[{"callFunction":"get sys info"}]},{"eventType":"block","conditions":[{"id":"for-each","objectClass":"System","parameters":{"object":"Dictionary"}}],"actions":[{"id":"add-to-eventvar","objectClass":"System","parameters":{"variable":"text","value":"\"\\n\" & str(Dictionary.TagAt(index)) & str(Dictionary.GetDefault(str(Dictionary.TagAt(index)),\"null\"))"}}]},{"eventType":"block","conditions":[{"id":"compare-eventvar","objectClass":"System","parameters":{"variable":"text","comparison":1,"value":"\"\""}}],"actions":[{"id":"set-text","objectClass":"sys_info","parameters":{"text":"\"\\n PRESET \\n\" & text & \"\\n [---END---]\" "}}]},{"eventType":"block","conditions":[{"id":"else","objectClass":"System"}],"actions":[{"id":"set-text","objectClass":"sys_info","parameters":{"text":"\"Somethign went wrong here\""}}]}]}]}
more simplified version:
-
gets all the infro from platform info plugin
stores info into a dictionary
itterates through dictionary and appends it to a text box
output: