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

An AppleScript to open iTunes videos in QuickTime Apps
After having recently upgraded my hard drive, I was finally able to fit all my music into one location. Since I have the room (for the moment), I thought about investigating using iTunes to also hold music-related video material, in addition to MP3s. So this led me to the iTunes Music Store, where I found myself watching and saving a couple of videos off their site, and then importing these videos into iTunes.

Howver, it was then that I discovered that for some reason, iTunes will only let you play videos off of the iTunes music store, and you can only play these when online. I find it odd that I can watch QuickTime movies online, but that I can't watch local QuickTime movies via this same program. The odd thing is that iTunes can handle many attributes of the video files. For instance, you can set the artist and track name and such, just as with an MP3. iTunes remembers the meta data, associating it with the file, and letting you interact with it as you would an MP3. Also, iTunes will only play back the audio portion of local videos. The actual video doesn't play unless you're streaming it off the iTunes music store. At least these are my experiences. If you know of how to make iTunes play locally saved video files, please post a quick note about how to to this.

The meta data is similar to an MP3's data, and iTunes will use the first frame of video as artwork for the track, similar to how you can assign album images to MP3s. So it knows its dealing with a video file, I know it can play video files, since it plays the music store tracks, but iTunes will only play the audio portion of locally stored files. I spent a considerable amount of time looking into a way to associate file types to an external player from within iTunes, but I didn't find anything, so hopefully this isn't a dupe hint.

My workaround for the video limitations of iTunes was to create an AppleScript which will open all of the selected tracks externally in QuickTime. I really hope that the next version of iTunes makes up for this deficiency. It's my first working AppleScript, so go easy on it! I basically cobbled some other scripts in with some original code, but it seems to be working fairly well so far. If you can improve upon it, please post the changes back to this site so that I can learn a bit. It could use some improvement; for instance, I'll probably eventually add filtering to verify that the files being opened are QuickTime compatible before opening the player. But for now, this meets my needs.

I tied this script to a button combo via the iKey macro/automation program. I used Shift-Command-Space for an iTunes-specific command to run the script, thus space now plays an audio file (iTunes default behavior), and Shift-Command-Space plays video files.

[robg adds: I haven't tested this one...]
    •    
  • Currently 2.50 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (2 votes cast)
 
[22,199 views]  

An AppleScript to open iTunes videos in QuickTime | 10 comments | Create New Account
Click here to return to the 'An AppleScript to open iTunes videos in QuickTime' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
An AppleScript to open iTunes videos in QuickTime
Authored by: suastegui on Apr 08, '05 01:04:20PM

Although I have no Applescript, this is what I do: play the complete video in iTunes. Don't quit iTunes. Open /private/tmp/501/TemporaryItems. You'll find a file like QTPluginTemp1234567. Copy it to a different location and rename it to xxx.mov. The Applescript is up to you....



[ Reply to This | # ]
An AppleScript to open iTunes videos in QuickTime
Authored by: virtual brain on Apr 08, '05 04:32:42PM

An apple script to just that is: iGetMovies - 2.1.1
get it from versiontracker



[ Reply to This | # ]
An AppleScript to open iTunes videos in QuickTime
Authored by: zlugg on Apr 08, '05 10:04:24PM
To open every temporary quicktime movie:
set TheStartupDisk to path to startup disk as string
set UsersIDNumber to do shell script "id -u"
set FolderForTemporaryItems to (TheStartupDisk & "private:tmp:" & UsersIDNumber & ":TemporaryItems") as alias

tell application "Finder"
	set TemporaryMovies to every item of FolderForTemporaryItems whose name starts with "QTPluginTemp"
end tell

repeat with i from 1 to the count of TemporaryMovies
	set ThisMovie to (item i of TemporaryMovies) as alias
	tell application "QuickTime Player"
		activate
		open ThisMovie
	end tell
end repeat


[ Reply to This | # ]
An AppleScript to open iTunes videos in QuickTime
Authored by: kirkmc on Apr 10, '05 06:18:15AM

A couple of comments...

iTunes won't play QT movies, because it's not designed to do so. When you view QT movies in the iTunes Music Store, you're not actually seeing them in iTunes - you're seeing them in WebKit, which is the same service that Safari and other web tools use to display web pages. The iTMS is simply a web site, albeit one that runs within iTunes - think of it as a frame in the iTunes window.

As for QT films and attributes, you can set tag info because iTunes uses QT-compatible files. You can also set tag info for PDF files that you store in iTunes, though with PDFs, you can just open them with a double-click from within iTunes, then view them in Preview or Acrobat.

---
Read my blog: Kirkville -- http://www.mcelhearn.com
Musings, Opinion and Miscellanea, on Macs, iPods and more



[ Reply to This | # ]
An AppleScript to open iTunes videos in QuickTime
Authored by: swedentom on Apr 10, '05 06:40:40AM

No, iTunes does not use WebKit in any way. iTMS uses a specially designed XML format to build the pages. So in a way, you can say iTunes is actually designed to play movies.



[ Reply to This | # ]
An AppleScript to open iTunes videos in QuickTime
Authored by: anamexis on Apr 10, '05 03:33:37PM

Perhaps you've heard of XSLT.
It's stylesheets to display XML in any way, and it's fully supported by WebKit.

So yes, iTMS does use WebKit.



[ Reply to This | # ]
An AppleScript to open iTunes videos in QuickTime
Authored by: wootest on Apr 10, '05 05:17:24PM
Actually, *no, it doesn't*. Here's Dave Hyatt, a chief engineer of Safari (and WebKit) saying it doesn't. My guess is it's something using some of QuickTime's abilities - I once saw an iPod campaign site by Apple where QuickTime was used a bit like Flash.

[ Reply to This | # ]
An AppleScript to open iTunes videos in QuickTime
Authored by: SmokyMcPott on Apr 16, '05 04:09:23PM

I've came up with some more "tricks" to use when storing your videos in iTunes, and thought I'd pass them along. First though, I wanted to clarify the original hint real quick:

It looks like some people thought that the hint was regarding saving the videos after playing them them in iTunes, and this isn't the case. The original hint, and the ones I'm adding today, deal only with storing & playing your videos alongside your music, within iTunes; Not with how you'd get them stored local on your hard drive in the 1st place.

Ok... Now on to the additions:

I've found that storing your videos as Quicktime .mov files result in the most flexibility, as far as what you can do with the video from within iTunes. If you own Quicktime Pro, you can easily and quickly convert your videos to similarly-sized .mov files by doing the following:

1. Open the video in Quicktime
2. Chose "Save As" from the File dropdown menu, and check the "Make movie self contained" option before saving the movie.

When done, you should have a .mov file that's aprox. the same size as the original file. Now, drag this movie into iTunes, over the library icon, and wait for iTunes to import it.

Once the movie's imported, you can assign meta data to it from within iTunes, however the thumbnail image associated with the file will be locked to the first frame of the video file. I've found a fairly straight-forward way to handle this though:

The key is adding a one-frame insert to the beginning of your movies, which will contain the image. This can be an external image, or a frame from within the movie which you feel represents the clip well. Here's how I've been adding such images:

Open the movie in Quicktime -I reccomend you do this after you've imported the movie into iTunes, and after you've opened it up for playing from within iTunes (in order to verify that you're working in the same copy of the file which iTune's tracking).

After opening the file, use Quicktimes slider to find a frame of the video that you want to use as the thumbnail. Once you've found one, hit command-E, to Export the file, and choose to 'Export to picture'. Now here's an important part: Save the picture to the same folder that the video's housed in.

For some reason, when I saved the images elsewhere, iTunes would sometimes lose track of the file, resulting in an error.

Now, open the new image in the Preview app (for most people, this means you can just double click it after saving it), hit command-A to select the entire image, and then command-C to copy the image.

Now flip back to Quicktime and set the focus to the very beginning of the file, and then hit the key combination of option-command-V to add the image that you just copied, as the very first frame of the file. Then hit command-S to save the file, and you're done!

The next time you view the video in iTunes, you'll see the picture as the thumbnail for the movie.

I realize that this is a great candidate for an Applescript, but I haven't had the time to look into that yet. Truthfully, I'm thinking that I'll wait for Tiger and then use this as a good test for the Automater application. 8)

Here's a couple of other things I've found which really help with this:

Set the genre for all you videos as "Video", and then set the "Grouping" value to the actual genre of the video content. So, for example, if I were adding a video of Nashville P*ssy, I would set the genre to 'Video', and the grouping to 'Rock'. Then it's a simple matter to make smart albums check both the genre value and the grouping value of files, to make the video show up in such a search.

Another thing I do is set the album values for videos to "[Band Name] Videos", so using the previous example, if I look up "Nashville P*ssy" to see all the music I own by them, I will see an additional album listed, named 'Nashville P*ssy Videos', which contains all their videos which I own.

Finally, I also append one of the following to the Video tracks name:
(Video Single), (Concert Video), (Multi-song Video), (Interview Video), so that when I'm browsing by artist, and the videos show up as songs, that I can tell them apart from the rest of the mp3 songs.

Also, it's probably worth re-mentioning that iTunes can play any video that Quicktime supports as a regular music file. So if you have a really cool cut of a song, but it's a concert video, you can include it with your playlists, and iTunes will treat it like any other music file.

Hope this helps someone... I think that it makes a lot of sense to store music-related videos alongside the music of the same artist, and other then having to play them externally in order to see the video portion of their content (re: my original hint), you can treat them as a regular old music file in every other aspect, meaning that you can include them in your smart lists, groupings, and playlists.

Also, it's probably worth reiterating that if you use this script to open these videos, then it's probably worth tying it to a mouse action so that you can click to open the files, just as you would any iTunes file. It makes the whole thing a lot more fluid.



[ Reply to This | # ]
An AppleScript to open iTunes videos in QuickTime
Authored by: venividivici on May 03, '05 05:49:41PM

Well, after I had an script all working great and using 10.3.9... and updating to QT 7, What the heck happened? Now there is nothing from QTPlugin* at /priv/tmp/501/

Did QT 7 has a new way of doing things or what do i have messed up with my system?

Is anyone using 10.3.9 with QT 7 and are able to download the videos?

Has anybody checked If 10.4 and QT7 lets you do what we used to do before,which is download trailers and videos from inside iTunes?

Let me know.



[ Reply to This | # ]
An AppleScript to open iTunes videos in QuickTime
Authored by: timhaigh on May 07, '05 10:38:25PM

In 10.4 with QT7 it seems cache files here

/Users/yourname/Libarary/Caches/Quicktime/Downloads

the file names look like

2dbe214f-8d86709f-20d199b8-5cf0604a.qtch

renaming them to .mpg or .mov or whatever does not seem to make them playable in any media player.

Although I managed to get a cached mp3 to play in mplayer but the sound quality was terrible.

Maybe apple finally made movies unrippable from webpages and itunes videos with the release of QT7



[ Reply to This | # ]