skip to Main Content

In my Photoshop javascript (using ExtendScript toolkit), I need to download an image before processing it. I’m trying with wget, as such:

app.system("wget https://dl.dropboxusercontent.com/u/73950/IMG_1827%20%282%29.png > ~/Desktop/test.png");

Unfortunately, this produces an empty png file.

What’s the correct way to download files from url when scripting with Photoshop?

2

Answers


  1. Tried your wget command without luck. But it worked with curl for me.

    app.system("curl -o ~/Desktop/test.png https://dl.dropboxusercontent.com/u/73950/IMG_1827%20%282%29.png")
    
    Login or Signup to reply.
  2. It’s working only for Mac, below is the way for both:

    if ( Folder.fs.indexOf("Win") > -1 ) {//SYSTEM IS ONE OF THE WINDOWS
        app.system("cmd.exe /c "bitsadmin /Transfer myDownloadJob " + imageUrl + " " + localImgPath + """);
    }else{
        app.system("curl -o " + localImgPath + " " + imageUrl);
    }
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search