Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8050523
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T07:06:26+00:00 2026-06-05T07:06:26+00:00

I need to download a .png file from an AppleScript. The problem is that

  • 0

I need to download a .png file from an AppleScript. The problem is that I am behind
a proxy server, so that when I use:

1) curl, the script gets stuck and never connects.

set image to "http://upload.wikimedia.org/wikipedia/commons/6/63/Wikipedia-logo.png"
set thePath to (path to desktop as Unicode text) & "test.png"

do shell script "curl -f " & image & " -o " & the POSIX path of thePath

2) URL Access Script, the script also gets stuck

set image to "http://upload.wikimedia.org/wikipedia/commons/6/63/Wikipedia-logo.png"
set thePath to (path to desktop as Unicode text) & "test.png"

tell application "URL Access Scripting"
    download image to file thePath replacing yes
end tell

I know there is a way to specify the proxy server in curl:

do shell script "curl -x " & HTTPProxy & ":" & HTTPPort & "-f " ...

But I don’t know what the values are for HTTProxy and HTTPort, as my system uses Auto Proxy Discovery. Even If had these values, my script would just work behind my proxy and in other systems behind other proxies.

Thus, I wonder if there is a way to tell curl or URL Access Scripting to use the system proxy, or if there are system variables storing these proxy values.

Thanks in advance

SOLVED

I found a way to do this by setting HTTPProxy and HTTPort to:

set HTTPProxy to (do shell script "networksetup -getwebproxy  \"Ethernet\" | grep \"Server:\" | awk -F \": \" '{print $2}'")
set HTTPPort to (do shell script "networksetup -getwebproxy  \"Ethernet\" | grep \"Port:\" | awk -F \": \" '{print $2}'")

I don’t know if there is a neater way to do this, but this seems to work 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T07:06:27+00:00Added an answer on June 5, 2026 at 7:06 am

    I found a way to do this by setting HTTPProxy and HTTPort to:

    set HTTPProxy to (do shell script "networksetup -getwebproxy  \"Ethernet\" | grep \"Server:\" | awk -F \": \" '{print $2}'")
    set HTTPPort to (do shell script "networksetup -getwebproxy  \"Ethernet\" | grep \"Port:\" | awk -F \": \" '{print $2}'")
    

    I don’t know if there is a neater way to do this, but this seems to work 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to download file from FTP server and make some changes on it
Ive got a VBS Script that,generates an url to download a file from a
I need to download an .mp3 audio file from a server to save in
I need to download an image from some URL to my server. However, my
I need to write a WCF method for downloading large file from server like
I am attempting to download a gunzipped file from an FTP server. It appears
i need to save a xml file from a server.. i found a code
I have a PHP script that produces a .CSV export file from a MySQL
I need to install the apk file from server. Its downloading when i connect
I need to download a file from a website using different threads and downloading

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.