I’m going to use some content from an AppleScript dictionary server-side. I need to dump the whole dictionary contents to a JSON file. I need to do this in AppleScript.
How would I do that?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
you can open the dictionary in script editor then do a save as and you get an xml file. I don’t think it would be worth converting it to json I would just use the xml
ohh ok
instead of using choose file or choose folder you can just give the script alias
for example
EDIT (reply to comment)
@mofle what your asking to do is impossible. Applescript is used to drive applications. So you write code that telling it what you want and what you want to do with it there is no generic way to say give me every thing from some random app and export it to XML. If there was believe me we would all know about this because the sure would be something cool.
that said if you know what application you are targeting and you know what you want to get out of it AND its accessible trough apples script there are was to export data to XML though you may find these techniques cumbersome . Depending on the app will really depend on your best approach to get the data you want . If you are only doing this with one app say “evernote” and you just want to get all the notes in XML if evernote has the ability to export to XML then you could write a script to do that.