Author Topic: Applescript and Yummy question  (Read 2925 times)

shafiq

  • Newbie
  • *
  • Posts: 1
Applescript and Yummy question
« on: January 23, 2008, 09:01:31 PM »
Hi

I am trying to write an applescript that will allow me to download a file into a specified folder and if a file by the same name already exists, then to delete and or overwrite the file.

I need some help with the code I should write. The following snippet was kinda hacked together as I am new to scripting :-(

So far I have the following code but the first part is not working. Any help is appreciated. I get the message "Can't get folder"

--Start
tell application "Finder"
   try
      delete files in folder "/Users/James/Documents/Folder"
   end try
end tell

tell application "Yummy FTP"
   activate
   connect "www.somewebsite.com"
   using connection "wwww.somewebsite.com" list local folder "Users/James/Documents/Folder/"
   using connection "www.somewebsite.com" list remote folder "/httpdocs/"
   using connection "www.somewebsite.com" download "testfile.txt"
   disconnect "www.somewebsite.com"
end tell
--End

Thanks

JD

  • Administrator
  • FTP Guru
  • *****
  • Posts: 2157
Re: Applescript and Yummy question
« Reply #1 on: January 24, 2008, 03:02:41 PM »
Sorry for such a delayed reply.

I tested your script. The only thing I can see wrong is that the list local folder line needs a forward slash before Users so, it should be /Users/James/Documents/Folder


spacific

  • Sr. Member
  • ****
  • Posts: 250
Re: Applescript and Yummy question
« Reply #2 on: January 25, 2008, 12:48:03 AM »
... and of course "wwww." should be "www."