PlayWithMedia: Play selected files/folder with media player

Discuss and share scripts and script files...
Post Reply
serendipity
Posts: 3358
Joined: 07 May 2007 18:14
Location: NJ/NY

PlayWithMedia: Play selected files/folder with media player

Post by serendipity »

A simple script to play selected files or files inside folders with media player(s).
I have included 4 players:
Windows Media Player (default), XMplay, K-lite's Media Player Classic and Winamp.
Uncomment the one you want to use.

Notes:
1) You can select both folders and files in one go, the script will automatically include files inside the folders in the play list.
2) I have included only few audio extensions, you can add more audio/video extensions if you want.
3) The number of files you can include in playlist depends on how long your paths are. Shorter paths=more files.
PlayWithMedia.xys
(1.21 KiB) Downloaded 223 times

Code: Select all

////PlayWithMedia
//Play selected files/folders with media player(s)
// NOTE: a) Adjust paths to the players accordingly at step 4). 
//       b) Add/Remove extensions at step 3).


//1) Set variables
  focus;
  end (<get CountSelected> ==0, "Nothing selected");
  $files="";
  $char=chr(34); 

//2) Loop selected items
  foreach($folder, <get selecteditemspathnames |>) {
  IF(exists($folder)==2){
  $files= $files.folderreport("files", "r", $folder, "r", ,"|");
    }
   ELSE{
   $files=$files.|$folder;
    }
 }

//3)Add/Remove extensions (separate with |) and format file list
  $showext="*.wma|*.mp3|*.ogg|*.m4a";

  $files=formatlist($files,"f","|","$showext");
  end ($files=="");
  $files=$char.replace($files,"|","$char $char").$char;
 

//4) Open files with media player (remove // before "open" to use that player. Default is WMP)
//(A) WMP
  open """C:\Program Files\Windows Media Player\wmplayer.exe"" $files";

//(B) XMplay 
  //open """C:\Program Files\XMplay\xmplay.exe"" $files";

//(C) K-lite's Media Player Classic
  //open """C:\Program Files\K-Lite Codec Pack\Media Player Classic\mpc-hc.exe"" $files";

//(D) Winamp
  //open """C:\Program Files\Winamp\winamp.exe"" $files";
edit: included some comments.

little titty
Posts: 81
Joined: 15 Nov 2009 19:34

Re: PlayWithMedia: Play selected files/folder with media pla

Post by little titty »

thanks I'm going to try using it to play video files with sm player - will report back if it does/doesn't work

yes it works fine with Splayer of course wmplayer plays video too but I prefer Splayer. I'm only using it to play one file of course.
Why doesn't everybody have a great user name like mine?

Post Reply