Re: Wget response
Re: Wget response
- Subject: Re: Wget response
- From: Jay Louvion <email@hidden>
- Date: Fri, 28 Sep 2007 18:50:17 +0200
- Thread-topic: Wget response
Title: Re: Wget response
On 28.09.2007 16:41, "Axel Luttgens" <email@hidden> spake thus:
On 28/09/07 16:19, I wrote:
> On 28/09/07 14:44, Jay Louvion wrote:
>
>> [...]
>
>
>
> Hello Jay,
>
> [...]
> If this is true, you would then want not only to make use of the
> try... on error... end try" construct, but also to perform some
> parsing of the string returned by "do shell script" (which is just
> wathever wget writes on stdout).
> [...]
Sorry, but some Bad characters (TM) -see the other thread- have
disturbed my reading of your email.
So, if I understand you correctly, "do shell script" returns an empty
string when wget terminates without error, even if you see some output
when you execute the command in Terminal?
In that case, that would mean that wget send its output to stderr.
You could then just change your command
do shell script "wget options_and_arguments"
into
do shell script "wget options_and_arguments 2>&1"
and everything in my reply should apply.
My apologies,
Axel
Absolutely no problem Axel. Unfortunately, I followed your advice and the string is still empty.
In the case of a valid number here is what the Terminal returns:
[...]
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/xml]
[ <=> ] 61,934 387.59K/s
18:48:33 (385.42 KB/s) - `shopdesc?shop=54321' saved [61934]
If the number is invalid, it reads so:
[...]
HTTP request sent, awaiting response... 200 OK
Length: 0 [text/xml]
[ <=> ] 0 --.--K/s
18:40:09 (0.00 B/s) - `shopdesc?shop=12345' saved [0/0]
The file created contains no data and has simply changed it’s name from “shopdesc?shop=12236” to “shopdesc?shop=12236 2>&1” following your code suggestion.
Is there a syntax error do you think ?
Here is my code:
set JobNr to [NumberHere]
set TheURL to "http://www.lagalerie.com/lagalerie/shopdesc?shop=" & JobNr --& " 2>&1"
set TheCommand to "/opt/darwinports/bin/wget --http-user=[UserNameHere] --http-passwd=[PasswordHere] " & quoted form of TheURL
set the clipboard to TheCommand -- <-- so I can test the result in the Terminal as well
do shell script TheCommand
Thanks in advance,
j.
Jay Louvion
Studio Casagrande
3, rue Müller-Brun
1208 Geneva
T+4122 840 3272
F+4122 840 3271
www.studiocasagrande.com
P Please consider the environment before printing this email.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden