Skip to content

Instantly share code, notes, and snippets.

@marksherman
Last active August 29, 2015 14:27
Show Gist options
  • Save marksherman/edaac0928cc394f5d28f to your computer and use it in GitHub Desktop.
Save marksherman/edaac0928cc394f5d28f to your computer and use it in GitHub Desktop.
JSON representation of a simple App Inventor block
<xml xmlns="http://www.w3.org/1999/xhtml">
<block type="component_event" id="1" x="311" y="510">
<mutation component_type="Button" instance_name="Button1" event_name="Click"></mutation>
<field name="COMPONENT_SELECTOR">Button1</field>
<statement name="DO">
<block type="component_set_get" id="2" inline="false">
<mutation component_type="Button" set_or_get="set" property_name="FontBold" is_generic="false" instance_name="Button1"></mutation>
<field name="COMPONENT_SELECTOR">Button1</field>
<field name="PROP">FontBold</field>
<value name="VALUE">
<block type="logic_boolean" id="3">
<field name="BOOL">TRUE</field>
</block>
</value>
</block>
</statement>
</block>
<yacodeblocks ya-version="138" language-version="19"></yacodeblocks>
</xml>
[{"id":"1","outputConnection":null,"inputList":[{"type":5,"name":"WHENTITLE","fieldRow":[{"textElement_":{},"size_":{"height":25,"width":44.43809509277344},"text_":"when ","renderWidth":44.43809509277344,"renderSep":0},{"value_":"Button1","arrow_":{},"fieldGroup_":{},"borderRect_":{},"textElement_":{},"size_":{"height":25,"width":72.89190673828125},"text_":"Button1","visible_":true,"mouseUpWrapper_":[[null,"mouseup",null]],"name":"COMPONENT_SELECTOR","renderWidth":72.89190673828125,"renderSep":0},{"textElement_":{},"size_":{"height":25,"width":39.92842102050781},"text_":".Click","renderWidth":39.92842102050781,"renderSep":0}],"align":-1,"visible_":true,"renderHeight":25,"renderWidth":0,"fieldWidth":177.2584228515625},{"type":3,"name":"DO","connection":{"targetConnection":{"sourceBlock_":{"id":"2","nextConnection":{"type":3,"x_":379,"y_":562,"inDB_":true,"dbList_":[null,{"0":{"targetConnection":{"sourceBlock_":{"id":"3","inputList":[{"type":5,"name":"","fieldRow":[{"value_":"TRUE","arrow_":{},"fieldGroup_":{},"borderRect_":{},"textElement_":{},"size_":{"height":25,"width":44.55975341796875},"text_":"true","visible_":true,"name":"BOOL","mouseUpWrapper_":[[null,"mouseup",null]],"renderWidth":44.55975341796875,"renderSep":0}],"align":-1,"visible_":true,"renderHeight":24,"renderWidth":0,"fieldWidth":44.55975341796875}],"inputsInline":false,"rendered":true,"disabled":false,"contextMenu":true,"childBlocks_":[],"deletable_":true,"movable_":true,"editable_":true,"collapsed_":false,"workspace":{"isFlyout":false,"topBlocks_":[null],"svgGroup_":{},"svgBlockCanvas_":{},"svgBubbleCanvas_":{},"fireChangeEventPid_":22,"scrollbar":{"oldHostMetrics_":{"viewHeight":563,"viewWidth":1123,"contentHeight":1031,"contentWidth":1839.4402465820312,"viewTop":494.99999999999994,"viewLeft":295.9999999999999,"contentTop":27,"contentLeft":-420.44024658203125,"absoluteTop":0,"absoluteLeft":0},"hScroll":{"pair_":true,"horizontal_":true,"svgGroup_":{},"svgBackground_":{},"svgKnob_":{},"onMouseDownBarWrapper_":[[null,"mousedown",null]],"onMouseDownKnobWrapper_":[[null,"mousedown",null]],"ratio_":0.6023571584120974,"xCoordinate":0,"yCoordinate":548},"vScroll":{"pair_":true,"horizontal_":false,"svgGroup_":{},"svgBackground_":{},"svgKnob_":{},"onMouseDownBarWrapper_":[[null,"mousedown",null]],"onMouseDownKnobWrapper_":[[null,"mousedown",null]],"ratio_":0.5315227934044617,"xCoordinate":1108,"yCoordinate":0},"corner_":{}},"scrollX":-295.9999999999999,"scrollY":-494.99999999999994,"trashcan":{"svgGroup_":{},"svgLid_":{},"left_":1041,"top_":468},"warningIndicator":{"svgGroup_":{},"warningCount_":{},"iconGroup_":{},"iconMark_":{},"errorCount_":{},"iconErrorGroup_":{},"iconErrorMark_":{},"warningToggle_":{},"warningToggleText_":{},"left_":35,"top_":488},"dragMode":false},"isInFlyout":false,"type":"logic_boolean","category":"Logic","typeblock":[{"translatedName":"true","dropDown":{"titleName":"BOOL","value":"TRUE"}},{"translatedName":"false","dropDown":{"titleName":"BOOL","value":"FALSE"}}],"rgbArray_":[119,171,65],"svg_":{"svgGroup_":{},"svgPathDark_":{},"svgPath_":{},"svgPathLight_":{},"squareTopLeftCorner_":true,"squareBottomLeftCorner_":true,"width":72.55975341796875,"height":26},"errors":[],"warnings":[],"startDragX":622,"startDragY":536,"startDragMouseX":365,"startDragMouseY":52,"draggedBubbles_":[]},"type":2,"x_":622,"y_":536,"inDB_":true,"check_":["Boolean","String"]},"type":1,"x_":622.3521881103516,"y_":536,"inDB_":true,"check_":["Boolean"]},"length":1},{"length":1},{"length":2},{"length":1}]},"inputList":[{"type":1,"name":"VALUE","fieldRow":[{"textElement_":{},"size_":{"height":25,"width":27.301361083984375},"text_":"set ","renderWidth":27.301361083984375,"renderSep":0},{"value_":"Button1","arrow_":{},"fieldGroup_":{},"borderRect_":{},"textElement_":{},"size_":{"height":25,"width":72.89190673828125},"text_":"Button1","visible_":true,"mouseUpWrapper_":[[null,"mouseup",null]],"name":"COMPONENT_SELECTOR","renderWidth":72.89190673828125,"renderSep":0},{"textElement_":{},"size_":{"height":25,"width":5.332855224609375},"text_":".","renderWidth":5.332855224609375,"renderSep":0},{"value_":"FontBold","arrow_":{},"fieldGroup_":{},"borderRect_":{},"textElement_":{},"size_":{"height":25,"width":78.99786376953125},"text_":"FontBold","visible_":true,"mouseUpWrapper_":[[null,"mouseup",null]],"name":"PROP","renderWidth":78.99786376953125,"renderSep":0},{"textElement_":{},"size_":{"height":25,"width":19.828201293945312},"text_":" to","renderWidth":19.828201293945312,"renderSep":0}],"align":-1,"visible_":true,"renderHeight":25,"renderWidth":72.55975341796875,"fieldWidth":244.35218811035156}],"inputsInline":false,"rendered":true,"disabled":false,"tooltip":"If set, button text is displayed in bold.","contextMenu":true,"childBlocks_":[null],"deletable_":true,"movable_":true,"editable_":true,"collapsed_":false,"isInFlyout":false,"type":"component_set_get","category":"Component","svg_":{"svgGroup_":{},"svgPathDark_":{},"svgPath_":{},"svgPathLight_":{},"squareTopLeftCorner_":false,"squareBottomLeftCorner_":false,"width":337.9119415283203,"height":30},"typeName":"Button","setOrGet":"set","propertyName":"FontBold","isGeneric":false,"instanceName":"Button1","rgbArray_":[38,102,67],"errors":[{"name":"checkIsInDefinition"}],"warnings":[]},"type":4,"x_":379,"y_":536,"inDB_":true},"type":3,"x_":379.03150939941406,"y_":536,"inDB_":true},"fieldRow":[{"textElement_":{},"size_":{"height":25,"width":18.031509399414062},"text_":"do","renderWidth":18.031509399414062,"renderSep":0}],"align":-1,"visible_":true,"renderHeight":29,"renderWidth":337.9119415283203,"fieldWidth":18.031509399414062}],"inputsInline":false,"rendered":true,"disabled":false,"tooltip":"User tapped and released the button.","contextMenu":true,"childBlocks_":[null],"deletable_":true,"movable_":true,"editable_":true,"collapsed_":false,"isInFlyout":false,"type":"component_event","category":"Component","blockType":"event","errors":[{"name":"checkIfIAmADuplicateEventHandler"}],"svg_":{"svgGroup_":{},"svgPathDark_":{},"svgPath_":{},"svgPathLight_":{},"squareTopLeftCorner_":false,"squareBottomLeftCorner_":false,"width":375.9434509277344,"height":65},"typeName":"Button","instanceName":"Button1","eventName":"Click","rgbArray_":[177,142,53],"horizontalParameters":true,"warnings":[],"IAmADuplicate":false}]
@marksherman
Copy link
Author

This code is the JSON that represents a project that has only this code block in it:
screen shot 2015-08-13 at 1 03 38 pm

I recommend installing a JSON viewer plugin and then viewing the file Raw.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment