View Full Version : Creating a random number within a URL using Applescript

Jul 19, 2012, 06:25 AM

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

Jul 19, 2012, 08:16 AM
-- random number between 0 and 1000
set randomNumber to (random number (1000)) as text
open location "http://example.com/something=(" & randomNumber & ")&something=....."
set theURL to "http://example.com/something=(" & ((random number (1000)) as text) & ")&something=....."
open location theURL