Hi! This is my first post here. I'd like to share two very simple scripts I have created to watch videos on an external player. Now, I'm a complete noob with Applescript, so I hope you can help me improve/expand them. Also, I'd like to know how these work in Tiger with older versions of VLC.
I like to listen to music from youtube while surfing the web. FlashVideoReplacer on Tenfourfox is good for that, but Quicktime, while being a lot better than Flash, still is a bit of a resource hog when compared to VLC. I don't even want to compare it to CorePlayer. So I tried to automate the copy and paste process of the video URL from browser to external player.
Copy and paste in Script Editor.
For VLC:
set myurl to the clipboard as text
tell application "VLC"
activate
GetURL myurl
end tell
For CorePlayer:
tell application "CorePlayer" to activate
tell application "System Events"
keystroke "u" using command down
keystroke "v" using command down
keystroke return
end tell
Choose a location on your hard drive and save.
Now we will create shortcuts for these scripts. Download a cool little app called Spark from here:
http://www.shadowlab.org/Software/spark.php
Install and launch Spark. Select file > New Hotkey > Applescript. Click on file and select the script you have just created. Assign a name and a keystroke combo, then click on create. For example I've assigned "alt -" to VLC and "command alt -" to Coreplayer.
For the scripts to work you have to copy the video url in the clipboard. Be careful! On youtube (and only on youtube) VLC will accept the link to the video webpage. Elsewhere you will need the link to the actual video file. Coreplayer accepts only links to video files and will freeze otherwise (not a big deal, just force quit). FlashVideoReplacer and DownloadHelper really come in handy here, especially when dealing with embedded videos. So on youtube (and for VLC) it comes to a simple sequence of "command l" "command c" "alt -" "command p". Do it again with other videos and you'll see how easy it is to create a playlist (so you can keep track of what you have watched/listened to). On other sites and with Coreplayer it's not so fast, but still very simple (with CorePlayer you also don't get playlists, but it still is the best if you want to watch HD clips).
The cool thing is that in both players, if you only want to listen to music, you can go to the preferences and disable the video output. This saves a lot of strain on the CPU. In VLC click on "enable video" in the video pane. In Coreplayer select "disable" for the video output.
While playing this clip (on my 1.25 GHz 1GB ram eMac)
http://www.youtube.com/watch?v=LfmrHTdXgK4
I get the following (on average) results from MenuMeters:
FlashVideoReplacer (quicktime): ~ 85% CPU usage
VLC (video enabled): ~ 50% CPU usage
CorePlayer (video enabled): ~ 35% CPU usage
VLC (video disabled): ~ 18% CPU usage
CorePlayer (video disabled): ~ 14% CPU usage
Flash (aah aah, king of the impossible!): ~ 95% CPU usage (I was actually expecting more, this must be Tenfourfox doing its magic).
I hope you'll find this useful.
I like to listen to music from youtube while surfing the web. FlashVideoReplacer on Tenfourfox is good for that, but Quicktime, while being a lot better than Flash, still is a bit of a resource hog when compared to VLC. I don't even want to compare it to CorePlayer. So I tried to automate the copy and paste process of the video URL from browser to external player.
Copy and paste in Script Editor.
For VLC:
set myurl to the clipboard as text
tell application "VLC"
activate
GetURL myurl
end tell
For CorePlayer:
tell application "CorePlayer" to activate
tell application "System Events"
keystroke "u" using command down
keystroke "v" using command down
keystroke return
end tell
Choose a location on your hard drive and save.
Now we will create shortcuts for these scripts. Download a cool little app called Spark from here:
http://www.shadowlab.org/Software/spark.php
Install and launch Spark. Select file > New Hotkey > Applescript. Click on file and select the script you have just created. Assign a name and a keystroke combo, then click on create. For example I've assigned "alt -" to VLC and "command alt -" to Coreplayer.
For the scripts to work you have to copy the video url in the clipboard. Be careful! On youtube (and only on youtube) VLC will accept the link to the video webpage. Elsewhere you will need the link to the actual video file. Coreplayer accepts only links to video files and will freeze otherwise (not a big deal, just force quit). FlashVideoReplacer and DownloadHelper really come in handy here, especially when dealing with embedded videos. So on youtube (and for VLC) it comes to a simple sequence of "command l" "command c" "alt -" "command p". Do it again with other videos and you'll see how easy it is to create a playlist (so you can keep track of what you have watched/listened to). On other sites and with Coreplayer it's not so fast, but still very simple (with CorePlayer you also don't get playlists, but it still is the best if you want to watch HD clips).
The cool thing is that in both players, if you only want to listen to music, you can go to the preferences and disable the video output. This saves a lot of strain on the CPU. In VLC click on "enable video" in the video pane. In Coreplayer select "disable" for the video output.
While playing this clip (on my 1.25 GHz 1GB ram eMac)
http://www.youtube.com/watch?v=LfmrHTdXgK4
I get the following (on average) results from MenuMeters:
FlashVideoReplacer (quicktime): ~ 85% CPU usage
VLC (video enabled): ~ 50% CPU usage
CorePlayer (video enabled): ~ 35% CPU usage
VLC (video disabled): ~ 18% CPU usage
CorePlayer (video disabled): ~ 14% CPU usage
Flash (aah aah, king of the impossible!): ~ 95% CPU usage (I was actually expecting more, this must be Tenfourfox doing its magic).
I hope you'll find this useful.
Last edited: