Re: Advice required with cURL, please!

Brian Christmas

Steve, thanks for trying, but your code, and my slightly amended code, both return…

Can’t set end of "<!DOCTYPE html>
<html style=\"height:100%\">
<head><title> 404 Not Found
<body style=\"color: #444; margin:0;font: normal 14px/20px Arial, Helvetica, sans-serif; height:100%; background-color: #fff;\">
<div style=\"height:auto; min-height:100%; \">     <div style=\"text-align: center; width:800px; margin-left: -400px; position:absolute; top: 30%; left:50%;\">
        <h1 style=\"margin:0; font-size:150px; line-height:150px; font-weight:bold;\">404</h1>
<h2 style=\"margin-top:20px;font-size: 30px;\">Not Found
<p>The resource requested could not be found on this server!</p>
</div></div></body></html>" to {{"ozsanta@..."}, {""}}.

What I want is the CONTENT of the file, not its properties, please?

AND, is my saving line correct?

I’m completely guessing, and Shane’s told me ‘DON’T GUESS!’, BUT I CAN’T WORK THE TERMINOLOGY OUT!.

What I THINK I’m doing wrong is addressing the .txt file in the wrong way. <p>The resource requested could not be found on this server!</p> I have no idea what I’m supposed to do, and have read the cURL help and examples over and over. I just cannot wrap my mind around what I’m doing wrong!



property EmailAddress : "ozsanta@..."
property businessName : ""
property theEmailList : {}

set theCheckPath to "“ # Modified for posting

set (my theEmailList) to {}
say 0
set (my theEmailList) to do shell script "curl file_get_contents " & theCheckPath
set (my theEmailList) to do shell script "curl  " & theCheckPath # Steve’s script
# do shell script "curl  file_get_contents " & theCheckPath & " echo " & (my theEmailList)
on error
say 0.1
set (my theEmailList) to {}
end try
if (count of (my theEmailList)) = 0 then set (my theEmailList) to {}
say 1
set end of theEmailList to {{EmailAddress}, {businessName}}
on error errmsg
set end of theEmailList to {{EmailAddress}, {businessName}}
tell application "System Events" to display dialog errmsg
end try
say 2
do shell script "curl -T -d " & (my theEmailList) & " --url " & theCheckPath
on error errmsg
tell application "System Events" to display dialog errmsg
end try


I’m deriving the path from this… which is in the same site folder

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">

The Site Inspector say their folder is /home/meselfso

On 23 Oct 2017, at 1:50 pm, Steve Mills <sjmills@...> wrote:

On Oct 22, 2017, at 20:53:06, Brian Christmas <ozsanta@...> wrote:

G’day scripters

I want to read a remote .txt file using cURL, and save the result to a variable, NOT a file.

set x to do shell script "curl " & theURL

Steve Mills
Drummer, Mac geek

Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (applescript-users@...)
Help/Unsubscribe/Update your Subscription:

This email sent to ozsanta@...

Join to automatically receive all group messages.