Author Topic: Open a Random File  (Read 956 times)

sosopika3

  • Newbie
  • *
  • Posts: 1
Open a Random File
« on: April 06, 2021, 08:23:32 PM »
I know voice attack has a open random sound which you can then say play a sound from a select pool of sounds, is this possible to do but with files?

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
Re: Open a Random File
« Reply #1 on: April 06, 2021, 08:29:39 PM »
You could generate a random number, and use a condition that executes a given branch based on the generated number.

E.G.
Code: [Select]
Set integer [~randomNumber] value as random from 1 to 4
Begin Integer Compare : [~randomNumber] Equals 1
    Run application 'C:\file1.txt'
Else If Integer Compare : [~randomNumber] Equals 2
    Run application 'C:\file2.mp3'
Else If Integer Compare : [~randomNumber] Equals 3
    Run application 'C:\file3.pdf'
Else
    Run application 'C:\file4.jpg'
End Condition