This project includes blocks to convert, edit, and analyze JSON format. Directions: - Press the "Input → JSON" button to convert the input list to a JSON array. - Press the "JSON → Output" button to change the JSON array back to a list. [Note: This will make each item in all nested arrays a list item. While the block does allow you to specify a layer at which this doesn't apply, this functionality isn't available yet unless you see inside.] - Press the green (top) button on Scratch Cat's remote to add an item to the input list. - Press the red (bottom) button on Scratch Cat's remote to delete all of the input list. Press it again to reset to the default list. !! The JSON → list function does not yet support JSON objects inside your array. !! Current features: - Convert List to JSON array: Changes the items in a list to a correctly-formatted JSON array, which is helpful for storing a list in a compact format or when using outside extensions that require JSON - Convert List to JSON: Changes a JSON array to a list, with each item in the array up to a specified layer being an item in the list. - Analyze JSON Array: Analyzes the layers in a JSON array and outputs each layer change in the "Layers" list. Item formatting: [Layer Number]-[Character Number]-[Start (0) or End (1) of Layer]-[Array(0) or Object(1) Layer]. (This block isn't available currently unless you see inside) - Other misc. technical blocks.
Inspired by JSON extensions that use arrays. Made for @we09532, at his request. Thank you to the Scratch team for the Scratch Cat with a party hat sprite, which is used in the thumbnail. You can use this in your project, just make sure that I am credited. Thanks! Version History - V1.4 - Analyze Layers function made more technical. JSON to List now has the option to flatten array after a specified layer. V1.3 - List to JSON doesn't put quotes around numbers V1.2 - List to JSON doesn't put quotes around arrays or objects. Analyze layers function added. V1.1 - Interface created. Side buttons (not used yet) added. V1.0 - Created. List to JSON and JSON to list functionality added.