Author Topic: Applescript - Add to queue  (Read 1178 times)

colonel_sanders

  • Jr. Member
  • **
  • Posts: 10
Applescript - Add to queue
« on: June 09, 2011, 09:55:32 AM »
Hello again,

Is there an applescript function to add a file to an existing download queue of a bookmark?  We work on a server with 16000 + files with the same naming convention.  I have made an application that downloads a file specified by the user via yummy, but if there is a queue, the script can't pass the file name to Yummy without opening a new connection.

Thanks,
C_S

JD

  • Administrator
  • FTP Guru
  • *****
  • Posts: 2156
Re: Applescript - Add to queue
« Reply #1 on: June 09, 2011, 11:18:44 AM »
No, there's no such capability. AppleScript support works such that once you start an action then no other actions can be initiated until the current one is completed. You will get a 'connection busy' result if you try.

You can open multiple connections, but then you lose the ability to track the result of the transfer - success or failure.

Or you can wait in a loop until the 'connection busy' result clears.

colonel_sanders

  • Jr. Member
  • **
  • Posts: 10
Re: Applescript - Add to queue
« Reply #2 on: June 16, 2011, 02:53:15 AM »
Hi JD,

Thanks for the information.  I put a timeout in the script and let it monitor the 'connection busy' result.

I have another applescript question.  I'm trying to pass a list of items to Yummy to download.  What format does the list need to be in? 

At the moment, once the script has been activated, the list (listVariable) looks like this {"ABC112927", "ABC096944", "ABC103640", "ABC096946", "ABC096947", "ABC096949", ""}.  When I pass it to yummy it downloads the first item listed alphabetically on the server, only.  If I only pass one file name to Yummy it works fine.

Any help is appreciated.  Very frustrating.  Thanks!
« Last Edit: June 19, 2011, 01:32:39 PM by colonel_sanders »

colonel_sanders

  • Jr. Member
  • **
  • Posts: 10
Re: Applescript - Add to queue
« Reply #3 on: June 16, 2011, 03:32:37 AM »
Even a simple script like this returns the same result (downloads first file on server listed in alphabetical order):

tell application "Yummy FTP"
   using connection "Connection" download {"ABC112927", "ABC096944"} to destination "Volumes/Source"
end tell

This works fine:

tell application "Yummy FTP"
   using connection "Connection" download {"ABC112927"} to destination "Volumes/Source"
end tell
« Last Edit: June 16, 2011, 03:35:36 AM by colonel_sanders »

colonel_sanders

  • Jr. Member
  • **
  • Posts: 10
Re: Applescript - Add to queue
« Reply #4 on: June 16, 2011, 09:26:20 AM »
I think I found the problem...

This works:
tell application "Yummy FTP"
   using connection "Connection" download thelist
end tell

This doesn't:
tell application "Yummy FTP"
   using connection "Connection" download thelist to destination "/Volumes/Source/"
end tell
Any ideas what I am doing wrong?

Thanks!
C_S
« Last Edit: June 16, 2011, 09:31:47 AM by colonel_sanders »

JD

  • Administrator
  • FTP Guru
  • *****
  • Posts: 2156
Re: Applescript - Add to queue
« Reply #5 on: June 16, 2011, 03:30:46 PM »
I'll investigate and get back to you asap

JD

  • Administrator
  • FTP Guru
  • *****
  • Posts: 2156
Re: Applescript - Add to queue
« Reply #6 on: June 16, 2011, 03:46:50 PM »
I'm sorry, it's a bug!  :o

The only work around at the moment is to issue a download command per item in the list. So you could set up a loop I guess, accessing each item in the list and issuing a download command for it.

JD

  • Administrator
  • FTP Guru
  • *****
  • Posts: 2156
Re: Applescript - Add to queue
« Reply #7 on: June 16, 2011, 04:00:13 PM »
Fixed in the next update  ;D

colonel_sanders

  • Jr. Member
  • **
  • Posts: 10
Re: Applescript - Add to queue
« Reply #8 on: June 17, 2011, 02:52:14 AM »
Ha!  Thanks JD  ;D.  Any idea when the next update is coming??

JD

  • Administrator
  • FTP Guru
  • *****
  • Posts: 2156
Re: Applescript - Add to queue
« Reply #9 on: June 17, 2011, 05:32:00 AM »
I'll send you a beta build asap, but that's likely to be towards the end of today to be honest. Is that ok?

colonel_sanders

  • Jr. Member
  • **
  • Posts: 10
Re: Applescript - Add to queue
« Reply #10 on: June 17, 2011, 05:50:43 AM »
Sweeet.  You da man!   ;D

JD

  • Administrator
  • FTP Guru
  • *****
  • Posts: 2156
Re: Applescript - Add to queue
« Reply #11 on: June 17, 2011, 03:19:38 PM »
You're welcome  ;D

I've sent you the download link via email

colonel_sanders

  • Jr. Member
  • **
  • Posts: 10
Re: Applescript - Add to queue
« Reply #12 on: June 19, 2011, 01:32:17 PM »
Works perfectly :D

Thanks again JD!

JD

  • Administrator
  • FTP Guru
  • *****
  • Posts: 2156
Re: Applescript - Add to queue
« Reply #13 on: June 19, 2011, 05:19:27 PM »
Thanks to you for finding & reporting the bug! Great to hear its all fixed up now :)