Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

A bash script to create RealPlayer playlists Apps
It seems to me that Realplayer 10 for Mac lacks any function for creating or managing a playlist. I have a folder full of .rmvb movies that I would like to play sequentially without having to open each time one movie ends. While I could just convert them to a more usable format (mpeg h.264?) and open them with a better player, instead I created a little bash script to make a playlist of all files in a directory (aka folder). I thought I would post my little script for those who are not clued on regular expressions or shell scripting.

I created a file in my home directory called makeram.sh and put in the following code:
#!/bin/bash
i=`pwd | sed s/'\ '/\%20/g`

for j in `ls | grep '\.rmvb$' | sed s/'\ '/\%20/g`;
  do
    echo file:\/\/localhost$i\/$j >> ./playlist.ram
  done
After saving the file, don't forget to make it executable with chmod +x ~/makeram.sh.

Basically, the script works by replacing any spaces with %20, and then constructs a single line of this format:
file://localhost/current_directory/filename.rmvb
It stores this single line in a file called playlist.ram. It does this for as many files exist that end in .rmvb in that directory. If you want to put other file types in the playlist, you can change .rmvb$ in the line that begins with for j in to reflect the extension of the file type you want to add. Then just run ~/makeram.sh again and it will append those files to the existing playlist.ram in that directory. For example, you could change it to .avi$ for avi files. Or you could do a regexp OR operation if you're so inclined.

Now I just navigate to the directory with the Real Media files in them and type ~/makeram.sh, and it creates a playlist.ram file for me in that directory. Opening the playlist.ram file with RealPlayer will play the files one after the other. You can skip forward or backward using Command-Right Arrow or Command-Left Arrow.

A more elegant solution would be to create a folder action or just some AppleScript to automatically create these files but, alas, I have no AppleScript clue. If someone could show me this in AppleScript, I'd love to see it.
    •    
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)
 
[12,634 views]  

A bash script to create RealPlayer playlists | 2 comments | Create New Account
Click here to return to the 'A bash script to create RealPlayer playlists' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
A bash script to create RealPlayer playlists
Authored by: rustin on Sep 04, '07 07:04:33PM

I made a goof. It looks like this only works for .rmvb files as far as I can tell. I tried it with avi's and it opened a whole ton of windows.



[ Reply to This | # ]
No script needed
Authored by: grobbins on Sep 05, '07 09:27:20AM

RealPlayer 10 for Mac OS X will create a playlist for you. Just drag several items into the RealPlayer window at once.

You can see the playlist file by holding the command and option keys while choosing the playlist from RealPlayer's File menu. It's just a text file that you can move or edit as you like.



[ Reply to This | # ]