Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Ibjr

macrumors 6502a
Original poster
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.
 
Counterfit said:
Perhaps Automator is better suited to this?

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.
 
Linkjeniero said:
if you can't find anything else, try installing wget (download it from http://www.gnu.org/software/wget/wget.html). It's a simple app that works in the terminal. You type "wget address" and you're done

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
 
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
 
WildCowboy said:
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

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.
 
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?
 
WildCowboy said:
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?

I just stuck http://www.yahoo.com in, but it doesn't seem to work for long strings with wmvs in it.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.