Send values to website (and not using open location)

Hi, i’ve searched the forum for any topic like this but havnt found any so…

Im new to this AppleScriptthing and at the moment im writing a script which i want to send values to a asp-page on a remote server. The thing is i can do this the easy way and use “open location” but the thing is i want this to happen without opening Safari (or any other browser for that matter).

The values are stored in the url querystring (super unsafe but it’s nothing secret im gonna send :wink: ).

So, anyone got any ideas???

You could use “curl”. Goes like this (using a means of getting your external IP address):


set theHTML to my get_URL("checkip.dyndns.org")
set myIP to word 21 of theHTML

on get_URL(this_URL)
    set browser_string to "'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-us)¬
          AppleWebKit/125.4 (KHTML, like Gecko) Safari/125.9'"
    return do shell script "curl " & (quoted form of this_url) & " -A " & browser_string
end get_url

Running this in the Script Editor will show your IP address as a result.