title: Applescript JSON extraction
body: <p>I have this JSON File and I need to extract data from it:</p>
  
  <pre><code>{
          "data1": "Hello",
          "data2":[
              {
                  "value1": "1092",
                  "value2": "1242",
                  "value3": "4234",
              }
          ],
          "data3": "Bye"
  }
  </code></pre>
  
  <p>I know how to get the value from <code>"data1"</code> and <code>"data3"</code> with this piece of code</p>
  
  <pre><code>set mJson to do shell script "curl -s 'https://apiURL...'"
  set AppleScript's text item delimiters to {","}
  set keyValueList to (every text item in mJson) as list
  set AppleScript's text item delimiters to ""
  
  set theKeyValuePair to item 3 of keyValueList
  set AppleScript's text item delimiters to {": "}
  set theKeyValueBufferList to (every text item in theKeyValuePair) as list
  set AppleScript's text item delimiters to ""
  set theValue to item 2 of theKeyValueBufferList
  set value to do shell script "sed s/[^0-9.,]//g &lt;&lt;&lt; " &amp; theValue
  return "$" &amp; text 1 thru 7 of value
  </code></pre>
  
  <p>But how to get the value in <code>"data2"</code> > <code>"value1"</code> since it is in a "sub categorie" of the JSON file?</p>
  
  <p>Can someone help me out?</p>