If this is your first visit, be sure to check out the FAQ by clicking the link above.
You may have to register before you can post: click the register link above to proceed.
To start viewing messages, select the forum that you want to visit from the selection below.
You'd probably want to get every file in the folder as a list, then generate a random number with a maximum of the 'count' of the files - then open the file at index.
something like this:
Code:
tell application "Finder"
set targetFolder to choose folder -- or set it via an alias
set allFiles to every file of targetFolder
set randomFileIndex to (random number from 1 to count of allFiles)
open file randomFileIndex of targetFolder
end tell