如何在applescript中解析JSON

如何在applescript中解析JSON,json,applescript,Json,Applescript,我使用以下语法: tell application "JSON Helper" set Resultado to (fetch JSON from Request) end tell 我得到: {结果:{格式化地址:{Rua Dr.Carmelo D'Agostino,628-Jardim Rincão,圣保罗-SP,02991-040,巴西\',部分匹配:真,地址组件:{短名称:\'628\,长名称:\'628\,类型:{街道号\},{短名称:\'Rua Dr Carmelo D

我使用以下语法:

tell application "JSON Helper"
    set Resultado to (fetch JSON from Request)  
end tell
我得到:

{结果:{格式化地址:{Rua Dr.Carmelo D'Agostino,628-Jardim Rincão,圣保罗-SP,02991-040,巴西\',部分匹配:真,地址组件:{短名称:\'628\,长名称:\'628\,类型:{街道号\},{短名称:\'Rua Dr Carmelo D'Agostino\,长名称:\'Rua Doutor',路线类型:{,{简称:\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\,{短名称:\'BR\'、长名称:\'Brazic\'、类型:{'country\'、\'political\'}、{短名称:\'02991-040\'、长名称:\'02991-040\'、类型:{'postal\'U code\'}}、几何:{视口:{东北:{纬度:-23.4323911219708,液化天然气:-46.725645019708},西南:{纬度:-23.43508292,液化天然气:-42728042,位置:{拉丁美洲:{2972949},地点类型:\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\结果:{格式地址:{卡梅洛·达戈斯蒂诺博士,628-圣保罗贾迪姆·林奇奥,02991-040,巴西,{部分匹配:正确,地址:元件:{短名:{628,\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\街道编号:{short_name:“Rua Dr.Carmelo D'Agostino”,long_name:“Rua Doutor Carmelo D'Agostino”,类型:{route},{short_name:“Jardim Rincão”,long_name:“Jardim Rincão”,类型:{political”,“sublocality”,“sublocalityãlevelãããã1},{short(name:“圣保罗”,longããã名称:“圣保罗”,类型:““行政区ã2级”,“政治级”},{short_name:“SP”,long_name:“圣保罗”,类型:{“行政区一级”,“政治”},{short_name:“BR”,long_name:“巴西”,类型:{“国家”,“政治”},{short_name:“02991-040”,long_name:“02991-040”,类型:{“邮政编码”},几何:{视口:{东北:{纬度:-23.432391299708,液化天然气:-46.725645019708},西南:{lat:-23.435089180292,lng:-46.728342980292},地点:{lat:-23.4337402,lng:-46.726994},地点类型:“屋顶”,地点id:“ChIJgVGzRqL7zpQRTQPNqsmBVLY”,类型:{“街道地址”},状态:“OK”}

现在我只想得到“位置”,换句话说,我只需要这两个值

lat:-23.4952611,lng:-46.6724604

这应该是不需要动脑筋的,但我在尝试了几个小时后还是没能自己做,所以任何帮助都将不胜感激

@瓦尼安利用你的技能(非常感谢你),你现在能告诉我如何获得:

“02991-040”显示在“格式化的_地址”上,也显示在此处

{短名称:\“02991-040\”,长名称:\“02991-040\”,类型:{“邮政编码”}


最好!

JSON被转换为AppleScript列表和记录

if Resultado's status is "OK" then
    tell location of geometry of item 1 of results of Resultado
        set latitude to its lat
        set longitude to its lng
    end tell
end if

JSON被转换为AppleScript列表和记录

if Resultado's status is "OK" then
    tell location of geometry of item 1 of results of Resultado
        set latitude to its lat
        set longitude to its lng
    end tell
end if