How to open multiple random files with applescript?
问题 I am successfully opening 1 random file, like this: tell application "Finder" open some file of folder "HD:random" end tell I would like to open 3 random files in the folder. 3 different ones. If I run the applescript 3 times I will get the same ones sometimes. Thanks! 回答1: Here's 1 way using "some file"... set theNumber to 3 set theFolder to choose folder set theFiles to {} repeat tell application "Finder" to set aFile to (some file of theFolder) as text if aFile is not in theFiles then set