Can and how do you get remote data (e.g. JSON) into AppleScript?

前端 未结 4 1173
猫巷女王i
猫巷女王i 2021-02-04 19:44

I\'ve got a Web-based API to which I would like to send POST/GET requests via AppleScript. I\'d like to retrieve and parse the response such that I can feed it into another app.

4条回答
  •  抹茶落季
    2021-02-04 20:01

    I parse XML/HTML/JSON etc. using regular expressions. AppleScript doesn't have native support for regular expressions but you can download a scripting addition called Satimage which will allow you to use them in your Applescripts.

    Download and install the scripting addition and then check out the Satimage user guide for instructions and sample code.

    If you're not familiar with regular expressions (or even if you are) an app called RegExhibit will help you find the right syntax for your scripts.

提交回复
热议问题