Different behavior between Script Editor and ASS app

Hi,

I discovered a strange behavior using a simple script between Script Editor and ASS studio app.
Basically I have these lines of code:

set shellScript_1 to "/usr/bin/curl --connect-timeout 30 -m 240 " & ftpMode & "–ftp-create-dirs -T " & filesList & " -u " & ftpUser & “:” & ftpPwd & " " & “ftp://” & ftpHost & ftpDir & folderName & “/”

try
do shell script shellScript_1
on error msg number errnum
display dialog “Generic Error”
end try

When I execute it from the Script Editor the try on error catch the error (you can simulate it switching off the FTP server or typing bad pwd.

The exactly same lines of code fails in ASS app.
The dialog “Generic Error” never appear.

Somebody can explain this behavior?

Stefano

Without seeing all of your code, I have a guess.

Try telling it where to display the dialog.

Tell application “Finder” to display dialog “Generic Error”

Let us know if that makes any difference.

Hi,

I found the source of problem, not yet the solution.

Forget previous email.

the problem seems this:

set shellScript_1 to "/usr/bin/curl --connect-timeout 30 -m 240 " & ftpMode & "–ftp-create-dirs -T " & filesList & " -u " & ftpUser & “:” & ftpPwd & " " & “ftp://” & ftpHost & ftpDir & folderName & “/”

in the quoted array fileList if I have 300 files curl wait 30 seconds for each file and return the final error only at the end of 30*300=9000 seconds.

Anybody can try to reproduce the problem?

I would like to have error if curl can’t connect to the server. This should be resolved by “–connect-timeout 30” but probably curl do this for each file to upload.

Any solution?

Stefano