Yummy Software
Welcome, Guest. Please login or register.
October 19, 2009, 06:36:31 PM
3719 Posts in 728 Topics by 807 Members
Latest Member: vanik
Home Help Search Login Register
Yummy Software  |  Yummy FTP  |  Yummy FTP Talk  |  with timeout of 32766 seconds or Try Statement? « previous next »
Pages: [1] Print
Author Topic: with timeout of 32766 seconds or Try Statement?  (Read 727 times)
melastudio
Newbie
*
Posts: 12


View Profile WWW
with timeout of 32766 seconds or Try Statement?
« on: July 15, 2009, 09:11:17 AM »

I see in your example You use:

with timeout of 32766 seconds
    do something
end timeout

If there is a problem, why I should wait 9 hours?  Smiley

It's not better the statement

Try
    do something
on error
    do someting else
end try?
Logged

Certified FileMaker Pro 9Developer
JD
Administrator
FTP Guru
*****
Posts: 1655


View Profile Email
Re: with timeout of 32766 seconds or Try Statement?
« Reply #1 on: July 15, 2009, 09:44:22 AM »

You need to use timeout because default AppleScript command timeout is only 2 minutes and of course any FTP operation (especially transfers) can take a lot longer.

Without the timeout value, a script will produce an error after 2 minutes, even though Yummy is still performing the operations successfully.
 
If there is any real problem then Yummy will return it and the timeout value will be ignored.
Logged
melastudio
Newbie
*
Posts: 12


View Profile WWW
Re: with timeout of 32766 seconds or Try Statement?
« Reply #2 on: July 15, 2009, 10:08:19 AM »

Without the timeout value, a script will produce an error after 2 minutes, even though Yummy is still performing the operations successfully.
If there is any real problem then Yummy will return it and the timeout value will be ignored.

OK.
But if I want to make another upload in the same sftp-erver but from and to other 2 different folders?
Can I make only one "With timeout/end timeout", like the following?

            connect "Lomax.bkmk"
            with timeout of 32766 seconds
               using connection "Lomax.bkmk" list local folder "/Users/macbook/Desktop/max/JPEG"
               using connection "Lomax.bkmk" list remote folder "/monica"
               using connection "Lomax.bkmk" upload "*"
               using connection "Lomax.bkmk" list local folder "/Users/macbook/Desktop/max/TIFF"
               using connection "Lomax.bkmk" list remote folder "/lomax"
               using connection "Lomax.bkmk" upload "*"
            end timeout
Logged

Certified FileMaker Pro 9Developer
melastudio
Newbie
*
Posts: 12


View Profile WWW
Re: with timeout of 32766 seconds or Try Statement?
« Reply #3 on: July 15, 2009, 10:29:55 AM »

i'm here again

This seems to work

         try
            tell application "Yummy FTP"
               activate
               connect "Lomax.bkmk"
               with timeout of 32766 seconds
                  using connection "Lomax.bkmk" list local folder "/Users/macbook/Desktop/max/JPEG"
                  using connection "Lomax.bkmk" list remote folder "/monica"
                  using connection "Lomax.bkmk" upload "*"
                  using connection "Lomax.bkmk" list local folder "/Users/macbook/Desktop/max/TIFF"
                  using connection "Lomax.bkmk" list remote folder "/lomax"
                  using connection "Lomax.bkmk" upload "*"
               end timeout
               --using connection "Lomax.bkmk" list local folder "/Users/macbook/Desktop/max/TIFF"
               with timeout of 32766 seconds
                  using connection "Lomax.bkmk" delete local item "*"
               end timeout
               using connection "Lomax.bkmk" list local folder "/Users/macbook/Desktop/max/JPEG"
               with timeout of 32766 seconds
                  using connection "Lomax.bkmk" delete local item "*"
               end timeout
               disconnect "Lomax.bkmk"
            end tell
            tell application "Yummy FTP" to quit
         on error
            display dialog "ERROR"
         end try

Suggestions are welcome!
:-)
Logged

Certified FileMaker Pro 9Developer
JD
Administrator
FTP Guru
*****
Posts: 1655


View Profile Email
Re: with timeout of 32766 seconds or Try Statement?
« Reply #4 on: July 15, 2009, 10:51:19 AM »

That's fine Smiley

You can indeed surround all your transfers with a single 'with timeout' & 'end timeout'
Logged
melastudio
Newbie
*
Posts: 12


View Profile WWW
Re: with timeout of 32766 seconds or Try Statement?
« Reply #5 on: July 15, 2009, 10:54:03 AM »

Yes!
How can I display the error if it happens?
I can't remember the sintax...

Many thanks
Logged

Certified FileMaker Pro 9Developer
JD
Administrator
FTP Guru
*****
Posts: 1655


View Profile Email
Re: with timeout of 32766 seconds or Try Statement?
« Reply #6 on: July 15, 2009, 11:52:52 AM »

If you mean a server error then this will be displayed in the Yummy FTP user interface. The actual message is not accessible via AppleScript.

However, each AppleScript command that Yummy implements will return a result code. Zero is always a success code. Other results will be given depending on the error and the command used. See the AppleScript dictionary of Yummy FTP in Script Editor to see the possible result codes for each command.

After each command is issued, the code is stored in the variable named result
Logged
melastudio
Newbie
*
Posts: 12


View Profile WWW
Re: with timeout of 32766 seconds or Try Statement?
« Reply #7 on: July 15, 2009, 12:03:55 PM »

After each command is issued, the code is stored in the variable named result

I missed this step!
Many thanks
Logged

Certified FileMaker Pro 9Developer
Pages: [1] Print 
« previous next »
Jump to: