javascriptafter-effects

Get / Read Text File from URL - Javascript for After Effects


I'm used to selecting, opening and reading a text file (CSV, JSON) from my local directory. I now have access to our data feeds online but don't know how to do the same thing with a URL instead of a local file.

For a local file I simply use something like this:

 var myFile = File.openDialog();
 myFile.open();
 myFile.read();

Is there a way to do this with a feed from a URL in javascript for AE?

Here is one of the feeds: feeds.nfl.com/feeds-rs/schedules.json


Solution

  • No need to save file, just one line do the trick =)

    data = JSON.parse(system.callSystem('curl -s "https://path_to_json"'));