View Full Version : URL Extraction from String with Applescript
Mar 7, 2006, 06:20 AM
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! :)
Mar 7, 2006, 10:23 AM
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?
Mar 7, 2006, 11:01 AM
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...
Mar 7, 2006, 11:35 AM
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. 42643
This will work with any list of URL's (without spaces in them) seperated by spaces.
Mar 7, 2006, 11:43 AM
wow thanks for your efforts. i'll give it a whirl when i get home tonight and report back :) :)
Mar 7, 2006, 12:22 PM
Mar 7, 2006, 03:01 PM
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 ?
Mar 7, 2006, 03:49 PM
I had a quick go but it isn't quick or clever...
I'm sure someone else could do better...