Highlighted

How can I use callSystem method to create a file from internet on WindowsOS?

Participant ,
Apr 09, 2020

Copy link to clipboard

Copied

I've found this code on github from fabianmoronzirfas Repo. This code only written for MacOS

 

 

    # Mac Osx
    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);

 

 

But I want to create a file from internet in Windows OS the curl cmd works fine when I manually enter in command prompt. (curl website/file.json > Desktop/file.json) will create a file. But when I put these code into the callSystem Method in extendScript it doesn't create a file. Can anyone help me to solve this issue?

Topics

How to, Scripting

Views

173

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

How can I use callSystem method to create a file from internet on WindowsOS?

Participant ,
Apr 09, 2020

Copy link to clipboard

Copied

I've found this code on github from fabianmoronzirfas Repo. This code only written for MacOS

 

 

    # Mac Osx
    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);

 

 

But I want to create a file from internet in Windows OS the curl cmd works fine when I manually enter in command prompt. (curl website/file.json > Desktop/file.json) will create a file. But when I put these code into the callSystem Method in extendScript it doesn't create a file. Can anyone help me to solve this issue?

Topics

How to, Scripting

Views

174

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Mylenium LATEST
Most Valuable Participant ,
Apr 10, 2020

Copy link to clipboard

Copied

Likely nothing to do with the script code at all, but those old pesky user permissions and security mechanisms, especially on the desktop. It has a whole different meaning on Windows. You will need to run the command line/ power shell with full admin privileges to begin with and may then need to mess around with manually settings user permissions using CALCS and otehr tools...

 

Mylenium

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...