Akaime aka Akaime aka - 1 year ago 167
AppleScript Question

Applescript - random number between

Using Applescript I wish to randomly display a number between set range of number, like:

display dialog {random number between "100" , "250" , "310" , "356" , "401" ,}

Cannot understand how the "between" works.

Answer Source

First of all "100" is not a number it's a string.

random number can be used only when passing a start and end value in the from and to parameters, for example

set x to random number from 1 to 100

To get a random number from an arbitrary list of numbers use some

display dialog (some integer in {100, 250, 310, 356, 401}) as text
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download