One frighteningly simple Applescript problem

Discussion in 'Mac Programming' started by Ibjr, Aug 29, 2005.

  1. Ibjr macrumors 6502a

    Joined:
    Jun 29, 2002
    Location:
    Eastern seaboard
    #1
    I know this is going to sound simple, but if you question my motives check the story at the bottom.

    I am trying to get an apple script to ask for input of a URL and then download to desktop whatever is at the URL. I have spent the last hour finding out automator has a way to download URLs but i can't find a way to pass the input to that.

    Story:I hate to do this but i am at wits end. I am a recent returner (and apple script is a lot more complicated than it was in os7 days) and some of our school's classes are online video (Univ of Florida Biz School) through a service that will only let you use IE. Every mac user i know is having trouble. I have found a way to download the videos (why doesn't mac IE have save target as?), and am looking for a quick script i can send out to people so they only need the URL and bam they have their econ lectures.
     
  2. Counterfit macrumors G3

    Counterfit

    Joined:
    Aug 20, 2003
    Location:
    sitting on your shoulder
  3. Linkjeniero macrumors 6502

    Joined:
    Jan 6, 2005
    #3
  4. Ibjr thread starter macrumors 6502a

    Joined:
    Jun 29, 2002
    Location:
    Eastern seaboard
    #4
    Yes. the problem is i can't find a way to pass a user inputed URL into the download URL thing. That is why i was looking at apple script.
     
  5. Ibjr thread starter macrumors 6502a

    Joined:
    Jun 29, 2002
    Location:
    Eastern seaboard
    #5
    Thanks. Won't work, the objective isn't to help me. its to help the other mac users the biz school is shafting. I used wget from the get go.

    Thanks though
     
  6. WildCowboy Administrator/Editor

    WildCowboy

    Staff Member

    Joined:
    Jan 20, 2005
    #6
    How about something like this:

    Code:
    set TheURL to text returned of (display dialog "Enter a file address" default answer "")
    set AppleScript's text item delimiters to "/"
    set Filename to last text item of TheURL
    set AppleScript's text item delimiters to ""
    
    tell application "URL Access Scripting"
    	download TheURL to file Filename
    	
    end tell
     
  7. Ibjr thread starter macrumors 6502a

    Joined:
    Jun 29, 2002
    Location:
    Eastern seaboard
    #7
    Stupid question, but would this be standalone or proceeding automator's download url? B/c it says, as standalone, error "URL scripting access got an error. bad name for file. some object"

    Well when i tried it within automator same error.

    Thanks for trying to help.
     
  8. WildCowboy Administrator/Editor

    WildCowboy

    Staff Member

    Joined:
    Jan 20, 2005
    #8
    Hmm...I'm no AppleScript expert, so troubleshooting isn't my thing. It's a standalone script that works just fine for me...help, anyone?
     
  9. Ibjr thread starter macrumors 6502a

    Joined:
    Jun 29, 2002
    Location:
    Eastern seaboard
    #9
    I just stuck http://www.yahoo.com in, but it doesn't seem to work for long strings with wmvs in it.
     

Share This Page