Import Json into Numbers
Last year I was guided fromsome awesome ppl here into an AppleScript that helped me paste information from an XML into my Numbers document. Unfortunatly, the xml is no longer pulling new data.
settgtTable to "NFL Scores" -- change if needed to match table name
setpasteCell to "B2" -- upper left cell of range to place values
set txt to do shell script "curl -s " & "http://www.nfl.com/liveupdate/scorestrip/ss.xml"
set pasteStr to ""
repeat with p in txt's paragraphs
set lineTxt to p's text
if lineTxt starts with " <g " then ¬
set pasteStrtopasteStr & ¬
getVal(lineTxt, "h=") & tab ¬
& getVal(lineTxt, "hs=") & tab ¬
& getVal(lineTxt, "v=") & tab ¬
& getVal(lineTxt, "vs=") & return
end repeat
set the clipboard topasteStr
tell application "Numbers"
tell front document'sactive sheet'stabletgtTable to set selection rangetorangepasteCell
activate
delay 0.2 -- vary this if needed
end tell
tell application "System Events" to keystroke"v" using {option down, shift down, command down}
togetVal(t, valTag)
set text item delimiterstovalTag
set val to t's text item 2's first word
endgetVal
I have found another option, but it’s .Json And I’m unsure if this would work in the way my previous one worked.
http://www.nfl.com/liveupdate/scores/scores.json
i was hoping someone could shed some light on this, thx
iPhone 6s Plus, iOS 10.0.1