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

mooty

macrumors regular
Original poster
Mar 7, 2006
142
0
UK
Hi All,

I want to extract an url, or number of urls from a string using applescript, and then set them to items in a list/array

Is this possible?

Thx for any help! :)
 

Eraserhead

macrumors G4
Nov 3, 2005
10,434
12,250
UK
yeah should be possible but it depends on how are you getting the url's?

are they saved in a text file?
if so how is the text formatted? (eg space's in between, a new line for each url?)
or are you getting them from safari or camino directly?
 

mooty

macrumors regular
Original poster
Mar 7, 2006
142
0
UK
it would be from a URL probably - ie an html file most likely. Let say that the url is hard coded in the applescript - and the script reads the html from that...

Thanks.
 

Eraserhead

macrumors G4
Nov 3, 2005
10,434
12,250
UK
OK I have made a simple applescript, I have read in some URL's from a text file (with the script), they are seperated by spaces. I hope it's useful. View attachment applescript.zip

This will work with any list of URL's (without spaces in them) seperated by spaces.
 

mooty

macrumors regular
Original poster
Mar 7, 2006
142
0
UK
wow thanks for your efforts. i'll give it a whirl when i get home tonight and report back :) :)

Thank you!
 

mooty

macrumors regular
Original poster
Mar 7, 2006
142
0
UK
Hi thanks for that - but is there a way to actually get urls from within HTML ? for example pick out all strings that start http:// etc ?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.