2016-09-15 19 views
0

之間的隨機數使用AppleScript我想隨機顯示號碼設定範圍之間的數字,如:AppleScript的 -

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

無法理解的「之間」的作品。

回答

1

首先"100"不是一個數字,它是一個字符串。

random number只能傳入fromto參數的起始值和結束值時,可以使用,例如

set x to random number from 1 to 100 

要從數使用任意的列表得到一個隨機數some

display dialog (some integer in {100, 250, 310, 356, 401}) as text