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

A script to remove Real Player's .RAM files Internet
I got tired of having my desktop filled with tiny Real Player files left behind everytime I watch NasaTV. I decided to solve the problem using Folder Actions. I wrote a small AppleScript, which I added to my Desktop Folder as a folder action. Everytime a .ram file is copied onto the Desktop, the script waits 10 seconds and then it moves the file to the trash. The 10 second delay is necessary so Real Player has time to read the file. Here's the script:

on adding folder items to this_folder after receiving added_items
  try
    repeat with i from 1 to number of items in added_items
      set this_item to item i of added_items
      set the item_info to info for this_item
      if the name extension of the item_info is in {"ram"} then
        do shell script "sleep 10"
        tell application "Finder"
          move this_item to trash
        end tell
      end if
    end repeat
  end try
end adding folder items to
This script can be extended to remove other annying files from similar applications. Just add their extension in the curly brackets that now contain {"ram"}.
    •    
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)
 
[21,400 views]  

A script to remove Real Player's .RAM files | 13 comments | Create New Account
Click here to return to the 'A script to remove Real Player's .RAM files' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
A script to remove Real Player's .RAM files
Authored by: benzado on Feb 02, '04 10:04:17PM
You can replace
do shell script "sleep 10"
with
delay 10
if you want to be an AppleScript purist.

[ Reply to This | # ]
delay vs. /bin/sleep
Authored by: gatorparrots on Feb 02, '04 11:55:15PM

The delay syntax hogs the CPU due to a bug; The /bin/sleep technique uses virtually no CPU resources.



[ Reply to This | # ]
A script to remove Real Player's .RAM files
Authored by: Nostromo1965 on Feb 03, '04 11:03:06PM

I copied and pasted this into Script Editor, saved it in my Documents folder, and added it as a Folder Action to my Desktop folder....and it doesn't work.

I checked the Folder Actions Setup for the Desktop folder, and it has that script attached to it. The script compiles OK, and it's in the same format (.scpt) as the other Folder Action scripts (in /Library/Scripts/Folder Actions (and why are there *2* "folder action script" folders in /Library/Scripts? "Folder Actions" and "Folder Action Scripts"???)). But when I listen to a story on NPR (a .smil file -- I changed the script to delete "smil" files), nothing happens. I even tried moving the script into the Folder Action script folders, and still nothing.

Is this working for other folks?



[ Reply to This | # ]
A script to remove Real Player's .RAM files
Authored by: firthy374 on Feb 04, '04 09:02:49PM

I can't get this to work either. I thought I was doing something wrong. At least I'm not the only one now.



[ Reply to This | # ]
A script to remove Real Player's .RAM files
Authored by: BradW on Feb 08, '04 03:52:42PM

It didn't work for me either, until I realized that somehow the script got saved with a .html extension. When I control-clicked on my downloads folder and went to Configure Folder Actions I saw the problem and resaved the script with a .scpt extension.

Brad



[ Reply to This | # ]
A script to remove Real Player's .RAM files
Authored by: Nostromo1965 on Feb 12, '04 08:30:56PM

Nope -- I saved mine with a .scpt from the get-go. Argh. Has anyone gotten this to work?



[ Reply to This | # ]
NASA TV: just re-use the same .ram file
Authored by: brycesutherland on Feb 03, '04 02:00:17AM

I too have been watching a lot of NASA TV lately (as well as very late!), but I just double click the one I got the first time I accessed the stream. No need to go to the web and re-download a .ram file.

Glenn



[ Reply to This | # ]
NASA TV: just re-use the same .ram file
Authored by: gsgm on Feb 03, '04 07:30:35AM

Do you have a URL to NasaTV?

Also, has anyone tried getting MacTV http://www.iWitnessTV.com to read multicast streams for Nasa?



[ Reply to This | # ]
NASA TV: just re-use the same .ram file
Authored by: murali1080 on Feb 03, '04 07:32:13AM

You don't have to clutter your desktop with .ram files for future access to the same site/ stream. You can go to File > Recent Clips in the Real Player for that if your preferences are set right!



[ Reply to This | # ]
A script to remove Real Player's .RAM files
Authored by: pinocchio on Feb 13, '04 12:20:41PM

I forgot to say in the original post that the script has to be moved to

/Library/Scripts/Folder Action Scripts

for this to work. In my system it wouldn't work otherwise.



[ Reply to This | # ]
A script to remove Real Player's .RAM files
Authored by: Nostromo1965 on Feb 27, '04 05:46:12AM

Has *anyone* gotten this to work yet?

The script has the correct extension (God, did you ever think you'd see the day you'd have to say that about something on the *Mac*?), and it's in the correct folder, and the Folder Actions thingy is configured correctly, and just for good measure I purged all of my caches, repaired privlieges and ran DiskWarrior (it was that time of the month, anyway...).

And it *still* doesn't work.

Any ideas?



[ Reply to This | # ]
A script to remove Real Player's .RAM files
Authored by: NikonFlyer on Mar 27, '04 09:19:25AM

I finally got this script to work! After saving it to the Folder Actions folder, make sure you go to the Desktop folder, right-click on it and select Enable Folder actions. Then right click again and select Attach a Folder action. Select the script you just saved.

Right click once more and ensure that the folder actions have been enabled and it should work.



[ Reply to This | # ]
A script to remove Real Player's .RAM files
Authored by: Nostromo1965 on Apr 09, '04 12:39:53AM

That's exactly what I did the first time.

Just for laughs, I tried it again.

Still doesn't work.

I'll just stick with dragging the files to the Trash. All the time I've wasted trying to get this to work far offsets any time savings in manually deleting those files from the desktop.



[ Reply to This | # ]