how to replace image form url in placeholder using After Effect CS6
Copy link to clipboard
Copied
I am using
var file = new File(<imagepath>); it is working fine for local image path
but i want to image url ie http://localhost:8080/abcd.jpg
Copy link to clipboard
Copied
maybe this thread will help:
Copy link to clipboard
Copied
This is not supported. You need to first download the file and store it somewhere on your hard-drive.
With the function
system.callSystem("PUT ANY TERMINAL COMMAND HERE")
you can execute arbitrary terminal commands. You can use this to download some files (how exactly depends on the operating system you are using, on Mac you can use curl, for example).
Copy link to clipboard
Copied
To add to the above point about using curl, I just ended up having to do this in a project, and after struggling with the ExtendScript socket logic (it may have had to do with the server I was trying to pull images from, or simply my own incompetence), I ended up following the solution, courtesy of FabianTheBlind, who I believe posts on this forum. Note that you have to change your General Preferences to allow scripts to write files across networks.
http://stackoverflow.com/questions/26285164/get-read-text-file-from-url-javascript-for-after-effects
var curlcmd = "curl feeds.nfl.com/feeds-rs/schedules.json > ~/Desktop/test/schedules.json";var stdout = system.callSystem(curlcmd);$.writeln(stdout);var file = File("~/Desktop/test/schedules.json");file.open();var content = file.read();file.close();$.writeln(content);

