Any way to play a randomly selected movie in a folder?

Im decent at python but not so much ruby, im trying to make a basic script that lets me simply choose a random video from folder. So for example, a simple script i had was using the RMMV script call for playing a video (its for RMMV but i use RMVXACE if that matters)
Code:
Graphics.playVideo(path/name.ext);
and turning it into
Code:
Graphics.playVideo("movies/" + rand(10).to_s + ".ogv");
which simply chooses a random video with the title being 1 to 10, and plays that video. But im not sure how to actually run that script, since using the "advanced script feature" aint workin. Thanks for any help
Graphics.playVideo("movies/" + rand(10).to_s + ".ogv");
Ruby:
  def command_261
    Fiber.yield while $game_message.visible
    Fiber.yield
    name = @params[0]
    Graphics.play_movie('Movies/' + name) unless name.empty?
  end
Ruby:
  def command_261
    Fiber.yield while $game_message.visible
    Fiber.yield
    name = @params[0]
    Graphics.play_movie('Movies/' + name) unless name.empty?
  end
thanks a ton that was quick i appreciate it

Original thread: https://forums.rpgmakerweb.com/threads/any-way-to-play-a-randomly-selected-movie-in-a-folder.121849/