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

moorbull

macrumors newbie
Original poster
Jul 19, 2012
1
0
Hi,

I'm quite new to applescript and guess this may be easy for some of the more experienced users to answer but I'm wondering..

How can I generate a random number with a URL and then get safari to visit the URL..

So for example.. http://example.com/something=(RANDOM NUMBER)&something=......

Thanks a lot
 
Code:
-- random number between 0 and 1000
set randomNumber to (random number (1000)) as text
open location "http://example.com/something=(" & randomNumber & ")&something=....."
--or
set theURL to "http://example.com/something=(" & ((random number (1000)) as text) & ")&something=....."
open location theURL
 
Last edited:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.