QuickTime • 1:13:08
By combining the automation capabilities of AppleScript with the power of QuickTime, you can dramatically improve your video production process. This session provides in-depth information on how AppleScript can automate your workflow, scale your production process, and achieve new levels of QuickTime functionality using AppleScript Studio. Learn time-saving tips, unique solutions, and just plain cool tricks.
Speakers: Rhonda Stratton, Sal Soghoian
Unlisted on Apple Developer site
Transcript
This transcript was generated using Whisper, it has known transcription errors. We are working on an improved version.
Let's get the whole view here, right? I got this shirt in Hawaii. I just came back from the Geek Cruise. Did anybody hear about the Geek Cruise? It's the weirdest thing. You know, you get a bunch of Mac heads on a boat with normal people, and you cruise around places.
So I did the Geek Cruise to Alaska last year, and this year was Hawaii. And it was interesting because in order to save money, you know, conferences are working together. So we had a combined conference. It was actually Macmania, which was the, you know, Mac geek part of it, Pearl World for Pearl guys, and Star Trek.
And you know, so you go into the main dining room and you're sitting there, they assign you seats, and the conversation was unbelievably strange. And this year I had Pearl going in like this while I was getting Vulcan stuff going that way, and somewhere in the middle they met and made sense. I don't know how it worked.
Thank you for spending time today and coming in for the AppleScript and QuickTime session. You're going to get an overview of what's available for you to use right now, what kind of QuickTime tools are out there, and some ideas about how to use them to automate some of the processes that you do with QuickTime content every day. Just a quick question so I can get a sense of whom I am talking to. How many of you in here are scripting already? Yes! See, your work has been validated right here. And I assume that most of you are also doing QuickTime content as well.
Okay, so there's some scripters in here I see by the disparity and difference there that are scripters that want to start incorporating QuickTime into their lifestyles. Is this true? Okay, right there, there's one right there. He just got a cable modem, he wants to live the QuickTime life. Okay.
I do too, all the time, I think. The story of AppleScript and QuickTime is one of the real unsung success stories at Apple Computer. And through the very diligent hard work of Gary Flynn, Tom Becker, Rhonda, Frank, and everybody involved in this, it's been an ongoing process. It's just bloomed and bloomed and bloomed.
And it basically came down to the same idea that affects every business is, how do I get consistency? How do I get accuracy? How do I get speed? How can I scale what I do and make more money and stay competitive? And the answer in any business, whether it's in multimedia or whether it's print or whatever kind of business it is, it's automation is the answer. So with that in mind, the QuickTime team and the AppleScript team focused on delivering quality.
And the core functionality that allows you to automate a lot of the repetitive things that you do with QuickTime content, such as applying annotations to 400 movies that are going to go up on the website. Done by hand, that's very tedious. Done with a script, it's go get a donut. So the whole idea is to incorporate this automation with the world of QuickTime. And so what I'm going to do, first of all, can I have laptop one, please? That was all the slides you're going to get out of me, by the way. I don't slide.
I like to show you what it is instead of talk about it. It's like dancing about architecture or something. So what we're going to look at first is what's available to us, what kind of resources are there, what kind of things has Apple done, where is it on my operating system, what does it look like? And then we're going to go from there into three core new features added in the most recent version of QuickTime just for AppleScript. Just for AppleScript.
You're very special. There are three extremely powerful features that can only be done with AppleScript. And they're in the new version. We're going to look at those. And I'm going to have a guest come up and show some of the automations based upon some of that technology that we use in-house and with some customers.
And then at the end, we're going to look at AppleScript Studio, which is part of the Xcode package. And what that allows you to do is create a native Mac OS X application using AppleScript, Objective-C, Java, C, or any combination thereof. But what we're going to particularly pay attention to with AppleScript Studio is the ability to talk directly to the QuickTime APIs from AppleScript. So all the commands that you wanted but you couldn't get to, you can now make yourself. And I'll show you an example project that you can download today and start using. So let's begin.
My first slide is going to take you to the venerable QuickTime website. We all know how to get there. QuickTime.com is the shortcut that the people in the know use. You can do the same for AppleScript as well. It's AppleScript.com. And down the right-hand side, you'll see a thing that says QuickTime products over here.
And under QuickTime Pro, there's a nice page that gives you all the reasons why you want to get QuickTime Pro. And trust me, if you don't have it, you do want to buy it because it turns on a lot of functionality that you really want to take advantage of.
[Transcript missing]
It's infectious, isn't it? It really is. This script menu is installed in the AppleScript folder, which is in the applications folder. You just double-click the thing that says script menu, and it installs up into the menu bar for you, and you can't see the glorious-looking icon that we have.
But by default, it has dozens and dozens, about 30 or 40 scripts pre-installed for you. And when you download this script collection, you can get the QuickTime broadcaster scripts and the QuickTime player scripts. And these 100 scripts right here are these scripts in this particular collection. It's really easy to install. You simply go to open the scripts folder, which is in your home library folder.
You drag your folder of QuickTime player scripts into that folder, and they show up in the menu. It really is that easy. And then anytime you need to run a script, you can access it from there. We have some nice scripts that really help save some time. For example, one that was that this was one of Rhonda's big ones.
She came to me about this one and said, Sal, we have to automate this. And it's chapter creation. Instead of creating text files with certain codings and importing it, this is really interactive. You literally just put the movie where you want to go and say, make a chapter here, and it will do that. We'll be demonstrating it. So all of these scripts. Deal with the various things about chapters, editing them, renaming them, deleting them. We have a section of scripts that just deal with the nuts and bolts of editing movie files.
For example, if you want to cut from the current selection to a new movie, instead of going through a bunch of steps on your own, there's a quick script to do it. Cut from the beginning, copy a selection to a new movie, edit a frame in graphic converter. That's a nice one. Merge the front movie into the second movie automatically for you. Scale the front movie to a specific percentage.
Little tools like that that you'd use throughout the day that each one saves you a couple seconds or saves you a half a minute. And by the end of the day, you're able to stay more focused on the task that you're doing than the how am I going to do this. There's a section of scripts for exporting. And there's a special one right here that we'll be talking about. Save export settings. That's a new feature.
There's a section of scripts that deal with favorites. And actually, an HTML embed tag wizard. If you've ever been daunted by the task of writing to HTML for a QuickTime embed tag, this actually walks you through it. It looks at the front movie and analyzes it and asks you a couple questions about what you want to do with it and then writes the embed tag for you.
We'll either put it into a file or copy it to the clipboard. There's a section on info scripts, and these give you more information for the front movie quickly. Here's a nice one. How to get to source URLs. You are also the front movie if you're interested in where a stream's coming from. Some miscellaneous ones.
Here's a very useful one that we'll be demonstrating. It's creating a thumbnail link movie to place into a web page so that it's a miniature of your movie. And when they click it, it actually launches your movie in the QuickTime player. That usually takes a lot of steps to create that and then embed it in your page.
And there's a script that does it very easily for you. There's some other navigation scripts, some play scripts, some previewing scripts, some property scripts. And these are setting the specific playback properties like auto quit when done, auto close when done, auto play, playback properties in general, href of the front movie. There's a couple scripts dealing with SMIL, S-M-I-L. If you want to be able to write XML but never got around to it, these scripts will write it for you.
And then there's a series of scripts dealing with text tracks and tracks in general. Just about every property that you want to deal with the track, you can deal with these scripts. And finally, an interesting script for setting the position of the movie in the window because movies remember that. And if you wanted exactly 72 pixels by 90 pixels down from the left, you can do this if you're anal retentive like me.
So there's a page that you're going to go to and you can download that script collection that I'm going to be demonstrating now from that site and start using these today to start saving yourself some time. Any question about that at all? No? Pretty straight ahead. Pretty straight ahead, isn't it? Okay. And this is the QuickTime scripts collection as it looks like when you download it. The readme file again is the same.
Open Safari, I hope. Nice, okay, let's just drag it up over here. The README file is the same file that you just saw. So all that explanation you don't have to write it down or copy it from the website. It's right there for you, a detailed description of each one of the scripts that we'll be dealing with. There's installation instructions that tell you, you know, where you're going to put the files, what you're going to do with them, what kind of requirements you have for the scripts. And then there's the collection of scripts themselves.
The applets, droplets, there's some example files to help you try out these scripts. There are some script templates that you're going to use today and that I'll be demonstrating that make actually writing the scripts a very easy process because they're pre-done for you. You literally just open up these templates, put in the couple lines of code that you want and save it. And all of the error handling and repeat routines and everything else has already been done for you.
I know I'm bowling you over with all this stuff, right? There is the collection of QuickTime player scripts, which are the ones that I have installed in the menu up here. That's the collection right here, the QuickTime player scripts. And there's some various images involved in this as well. And I have this new thing called export settings that we'll be looking at in just a little while. So let's begin by looking at some of the applets and droplets that are available and how they work and how you can use some of these yourself.
Yes? You can get those from the AppleScript website. They're on the page about Bluetooth and the clicker controlling the broadcaster. Yes, and you can just download them and copy them from there. I just got them and put them in a little collection. Any other questions before I roll on here? I'm sorry? I'm sorry? Okay.
Okay, very good. So, if it's a burning desire, wherever I got that from. No? Okay. Then we'll, as Rhonda pointed out so nicely to me, we'll save the questions for the end unless it's something really important. And then you can come up to the mic and say it so that we can get the translators to translate it so that everybody else in the world out there at large gets to enjoy this as well.
Here's our applets collection and there's the add to favorites, annotations drop, all annotations, annotations and credits droplet, clear all annotations. For example, and all of these droplets, the ones with the blue arrow, are designed to be double clicked and you get a preference dialogue. All of them have some kind of a dialogue that tells you what the script does and then usually has a set of preferences involved with it.
For example, if I click this, it says, do you want to retain the existing full name of the movie? When you set these settings and I say yes, and then you can enter a value for the album artist. I'll just click enter key. So you can set any of these properties and it will get stored in the script and be part of the settings when they get set.
So you can copy the script, keep a couple copies, rename it, call one, you know, internal use, call one website, call one, you know, CD use. And then based upon that, you can go ahead and save it. Okay. Okay. So, I'm going to go ahead and save it. Okay. Okay. Okay. what you're going to do with your movie, you just drag it on there and it sets the annotations.
Here's one called annotations and credits. This actually will make a rolling credits based upon your annotations but I'm going to start with the limited annotations droplet. Now this particular droplet applies a small subset of your annotations. It doesn't go through all 40 that are available. Just the ones that you have put into the property and to the comment window of that particular script. So I just got the information for that droplet and you'll see down in the comments field it says product colon.
Product is the name of the annotation, colon divides it from whatever value you're going to have. So I have three annotations, your video product, authors, ordinary user, performers, there's me, myself and I. So to set the annotations to a movie, I just drag that movie onto the droplet.
It opens up the movie, applies the stuff, and closes it. It's that fast. So now let's go back and open up that movie again. And then when I get the information for that movie, you can see up here that it applied the annotations for you automatically. Now, that's not so impressive with one movie, but it's very impressive with 300.
Small. We're starting small. We're building here. Okay. We're going to take that same movie now that has that applied, the annotations applied to it. I'm going to drag it onto the annotations and credits droplet and let that go. And it's going to want to know a destination for the new movie that it's going to make from this. And I'm going to just put this as a destination. Destination.
Create and choose that. So it'll open up the movie and then extract all the annotations, create a credits that goes in front of the movie, then save it off. Now, this is useful for if you're reviewing content and you can't keep track of every movie that you're seeing. You need something that brings up the annotations information first. So we'll go back to this destination folder, open up the movie, and then run it. And you'll see that it brings up the annotations information before it plays the movie.
[Transcript missing]
Plight Golf Clap, I like that. Very societal. Oh, these guys are great. Tarantino has nothing on them. And then it plays-- ah, of course, copyright.
[Transcript missing]
So there's an example of a script that builds upon something else that another script did. But that way you can now take that movie and give it to somebody else who's not familiar with your organization and your material, and they instantly have all the information in front of the movie, and it took me all of how many seconds to do it.
Little things like this make a big difference during the day. And let's continue to look for some of our other examples here. Display a folder as a slideshow. This is useful. I'll open the QuickTime scripts here, go to my examples files. And I'm going to choose a slideshow images. So this has a couple images in it. And what I'll do is I'll just drag that onto the script.
And now I have an instant slideshow just so I can preview and see what's going on. I don't have to actually import them into iPhoto to be able to quickly browse through a folder of images to see what I want. That ability is already built into QuickTime. Now if I want to save this at this point, I can, or I can just delete it and don't save it at all. But that's a quick way to do an entire folder as a set.
You can also, there's another pair to that one where you can save the entire folder as a slideshow as well, and that's called create slideshow from folder here. And that will go through the process of actually building it and saving it. So you can automate 40 or 50 slideshows if you want to do it that way. There's the limited annotations droplet that we just saw where it does a small amount of annotations. And then there's the playback scripts. For example, let me see. Let me open up another.
Switch. I hope you like switch ads because I'm going to use those as my material today. Is that okay? All right with that? Switch. All right. I'm going to double-click the script because all of our scripts can be set. There are preferences that can be stored. So the presentation is normal size continuation dialogue. Now, what is a continuation dialogue? Well, I made the script for automating the playback of movies and I forgot to give it a way to stop.
So what happens was guys internally at Apple were using these shows and they go, "Oh, okay. I got to stop." And they'd stop the one movie but the script would keep going and load the next one and it became Fantasia with the water wizard and everything happening all at once. So what this does is it brings up a quick dialogue for a couple seconds, self-closes, that says, "Do you want to go continue?" And that's an option you could say, "I want to display the movie at a normal size and bring me a continuation dialogue." Okay.
So let me just grab a couple of slides. I'll grab a couple of these and I'll try to do different ones each time we do them, okay? I'll grab this one and this one and I'll drag it onto the play movie script. Now, these you can keep in your dock as well.
Just have them there all the time. Get your iPod. iPod's here. I sell iPods at Dodger games. Two, and then you gotta pass them down kind of the way they sell hot dogs. I've got about 1,500 in the trunk of my car. I'm usually shirtless, just for effect.
The money just starts flowing in. You can listen to all these songs. I say at least over 50 songs. I'm not quite sure of the amount. I think it's like two million songs. My name is Will Ferrell, and I'm a porn actor. So it closes it, brings up the continuation dialogue.
Christmas songs that drive Santa crazy are I Saw Mama-- So I'm gonna just save that one for a little bit later, okay? And then the script senses that there's no more movies open, and it will close itself. So if you have a series of movies, again, that you wanna be able to just present, how do you do it? What do you do? You line 'em all up in the movie player, and then click, you know, click, click, click, and play all movies, and then they all start going . I'm Will Ferrell.
No, I'm Will Ferrell. So this is just a little organized way to do that. Now, as long as we're getting into being able to play movies, movies have specific invisible properties that make them very appealing. And some of these properties are such things as setting a movie to automatically close, or automatically quit, or automatically play.
Now, we know from the QuickTime player interface that you can set that flag in the properties to do an automatic play, but there's no place in the interface to set an auto close. So I'll take Will. I'm gonna drag him onto auto close. And now Will's ready to go. And so while I'm at it, I'm going to drag Will onto autoplay.
And now, Playwell. Christmas songs that drive Santa crazy are: "I Saw Mama Kissing Santa Underneath the Christmas Tree," "The Jingle Bell Rock," "White Christmas," "Forget It," "Enough," "I've Heard That Over a Billion Times," "Yes, Santa Has an iPod and Playlists," "980 Christmas Songs," And then 20 Doobie Brothers.
And one Sheryl Crow. My name is S. Claus. I live in the North Pole with elves and reindeer. So, did you notice the movie closed on its own? Nice way to present. So that stays with the movie file. As a matter of fact, if you use that movie linked from another movie or from a link in the website, this kind of thing happens. He's got all this stuff like prepared in a little example. Finds in where, where, Sally, Wally. Okay. Help Center. I'm going to find my copy of Safari.
So this is a QuickTime movie. It's a one-frame movie that has a href applied to it using the href droplet. And the href is interesting. It is a open bracket, self-present.move, close bracket. The self-present.move is the name of the movie that this is targeted to. The movie is naturally set to self-present, right? The T means target.
Then the next bracket is QuickTime player and bracket. And if you use this as your URL, what's that saying is open up this particular movie that's in the same folder as this file and play it in the QuickTime player. So a simple click on this opens up the movie.
you And then closes it. Nice way to present a movie from a web page, isn't it? Or from a help page. The user doesn't have to know anything about controls or about how to manipulate the player or anything else. All they have to do is just click. Click. Okay, click. Reload. Click.
Oh, the QuickTime player. That's because I have Panther installed on the other stupid partition. It's been bugging me all week. OK. Hold on. So click. So this movie's set to auto-quit as well as auto-close, right? So I'll relaunch the player here to get it back. So there's an example of how you can take that playback property and incorporate it and change the way that you're displaying the content on a website.
Okay, we're going to continue on. There is the auto-quit property, auto-play, and then there are some droplets for batch setting them. So if you want to set the playback properties back to where they were, you just drag it on top of this, and it gets rid of all those playback properties and returns the movie back to its pristine state. If you want to do them all together, then you can double-click this particular droplet and determine, you know, what time you want to have it for display, and then drag it onto that to set. So that's a couple of the, of those playback properties.
Another example where AppleScript can really help you save some time is in media skins. How many people are using media skins? How do you go about doing media skins? It's a multi-step process, isn't it? It's a quite involved process. You have to have all your materials together. It's like watching the Saturday morning cooking shows.
They make it look so easy because somebody else has already cut up the carrots, and they have the little thing here, and they just make their happy little mess. And then they don't even have to cook it. They just look at something that's already cooked, and they go, blah.
What a bunch of cooks. I don't think any of them can actually cook. So here's an example of how AppleScript can automate some of the process and take some of the sting out of making media skins. So you can really take advantage of this incredible technology that's unique to QuickTime. Here I have some of the elements that are incorporated in the process of making a media skin.
There's the media skin itself, there's the mask that indicates the area that's going to be cut away, and there's the drag mask which is going to indicate which part of the QuickTime skin is going to actually show. My source movie is this little movie here of a plane.
So I want the plane to fly through this queue. Now, instead of going through the multi-step process of having to do that by hand, I'm just going to take the plane and drop it onto this script. And it says, where do you want me to put this particular movie? When I get done with it, I'm going to say choose right there.
And I left these little dialogues in. You can turn them off. But I left them in so you can see the steps that it's doing. It's going to add the media skin to the background, move it to the back, activate transparent areas. Okay, that's a bug on my computer and nobody else's. That area that's white should actually be white. It's going to write the XML data to disk, open the new movie, and then apply the playback settings, save the finished movie, close it.
Delete temporary items, movie processed. So you can turn off those if you want to batch process this kind of thing. You don't have to have those dialogues running. And here is the resulting movie. On my computer, I have a bug in my computer that makes it so that you can't see through. So I'm going to go in here by hand and go properties of this movie. And I'll show you what it looks like, actually.
And we're going to choose media skin background, graphics mode, transparent, and set the color for white, I believe it is. That's black. This way, Sal. That's only on my computer. It's not on yours. This will actually work on your computer. Save it. Close it. And now launch it.
So that's a multi-step process. Thank you. It's a multi-stage process involving a lot of work that's now automated down to just a single drag and drop. And now we've added in some playback properties to make it even cooler. And that's, again, part of this whole collection of applets and droplets that are available for you from the website. There's other ones such as set controller type, set window position, save as uneditable, save in various formats like copy, make a copy as hinted, export it to a DV stream if you want to.
So all the export kind of ideas are available to you as well. I'll show you one more, which is the set href property. And I'm going to set the preference for the target URL to be http://www.apple.com/.applescript. And that's going to be the preference for this so that when I drag on any movie onto that script. And let's do this one.
[Transcript missing]
So that's how you set the href for a movie, very easily with AppleScript. Again, so you can begin to get an idea about a workflow that would involve maybe having a folder of some of your favorite automation scripts in a location on your computer, either on the dock or someplace else.
And as you're working with QuickTime content during the day, for those small tasks that you need to do, I need a copy of this in this format, I need to set this for our home URL, I need to set the annotations on this one. It's just a matter of you dragging to these little tools. It's like those neat little kitchen tool things.
Okay, let's take a look at some of the scripts that are part of the QuickTime scripts collection. I'm going to open up my Momoko again. And I'm going to add chapters into this movie. Now, how do you do chapters? How do you add chapters into a movie? You shoot yourself? Okay. It's an interesting way to go about doing it.
Probably a more pacifist way would be to use AppleScript, and we're going to try it that way. Thank you for being patient. So the QuickTime player, I'll choose chapters, and the first thing I'll do is create chapter track. And what that script will do is says, which track do you want to tie the chapters to? The audio or the video track, and I'll choose the video track.
So it goes through the process of creating a chapter track and inserting a chapter at the very beginning. Start. Now I'd like to add some, let's see, full screen. So go back right to there. Okay. So it's just about to, right there. So she's standing up. Okay. Now at that point, I'm going to go back to the QuickTime player, and I'm going to choose chapters, add chapter at the current time, and I'm going to give it a name of full shot. Right there. Click okay.
And you can see that it added a chapter there, and it has still wanted to start like that. And then I'm going to continue down over here to. Where it brings in the logo, logo. So I'll go back and choose chapters, add a chapter at the current time. I'll say logo. Logo. Choose OK. So now I have chapters inserted for a full shot. Start. Logo.
And of course, they change as the movie's playing. This one doesn't want to scroll very well today. If I want to delete one of those or rename a chapter, I can go back and do that. I'll choose chapter, and I could say delete chapter or rename a chapter. So instead of full shot, I'll call that halfway.
And you can see from our chapter list here, our chapter pop-up, it's halfway, start, and logo. Easy. Chapters are a piece of cake now. And what can you do with chapters? You can add chapters into your QuickTime content, and then when you put that into the new iDVD, it will automatically sense that and break those out into separate DVD portions for you. So you don't necessarily have to be in iMovie in order to add chapter tracks into your movie content. It's really easy to do right from AppleScript. Now, all of this has been happening because of the power of AppleScript working.
Behind the scenes talking to the QuickTime player. All of these scripts have involved the use of the QuickTime player application. It's actually the pro version. I got the pro version. I actually bought the pro version myself, I must say. I want to support my company. I bought the pro version myself. And then I took five keys off the server and used them for other things. But basically, I did pay more.
And all of this has been happening with the QuickTime player application, and it involves the process of writing scripts. When you write scripts and use AppleScript, as you guys well know, use the script editor. This is the first version of the new script editor beta 2. The second version has a lot nicer icons and a little bit different interface here, but it's basically the idea that this is the area right here in which you write your scripts.
Now I'm going to open up the dictionary or the internal commands available to us from AppleScript for the QuickTime player. And to do that, I went to the file menu and I chose open dictionary. I get this wonderful dialogue that shows me every scriptable app on my computer. Hopefully your computer does not look anything like mine.
And here is the dictionary for the QuickTime player. Now, since a lot of you have scripted before, you're not afraid of seeing this kind of a thing. This makes a lot of sense to you. There are the standard suite of events. These are commands that are common to most scriptable applications. They're usually a set of verbs or commands that indicate standard actions such as close, count, delete, does something exist, make, make a new movie, open, print, quit.
So these are the commands, the verbs that you use. And this section of the dictionary is the QuickTime player suite. And this contains commands and objects that are particular to the QuickTime player application. Under the category of classes, you see this collapsible thing right here. Those are the objects that can be scripted. There's commands or verbs that are the action, and then there's the nouns, which are the objects that can be scripted. And then there's the action, and then there's the action, and then there's the action, and then there's the action, and then there's the action.
There's annotations, and an annotation has some properties about it. It has a property called full text, it has an ID, it has a name. The application, which is the QuickTime player application itself, actually has a very interesting set of properties here. And it also shows you that the QuickTime player has these elements that belong to it. It has a display, which is your monitor, a favorite, a movie, a recent item, and a window are all things that the QuickTime player application deals with on a scriptable basis.
And these are some of the properties of just the application itself. And some of these are pretty interesting, like open movie and new player. So you can remotely have AppleScript control the way that the movie player on the customer's machine is going to respond before you even play the first movie.
So you can set this property, you can get this property, and change it as you need to. You can find out what is your current QuickTime connection speed. You can find out what QuickTime language is QuickTime Pro installed. What is the version of QuickTime? Do you want to show the equalizer? Do you want to show the favorites window? Do you want to show the movie window window? Do you want to show the welcome movie automatically? And what version of the QuickTime player are you dealing with? There are then the scriptable objects themselves that make up the QuickTime player. And one of the first ones we're going to go to at a higher level is the movie object.
Because we all deal with this pretty much. And a movie is composed of annotations, it has chapters, it has a file, or an internet location. An internet location for a stream, right? A file for a movie that you're running on a CD. It has tracks. It might have video tracks, audio tracks, graphic tracks.
Any kind of QuickTime track would show up here. And it has a window that the movie executes in. And these are the properties of a movie. And you can see that Gary's done an incredible job of supplying the kind of things that we need. It's really, really amazing.
There's your auto quit when done. And it says it's a Boolean value, which is true or false. So I could say, set auto quit when done of the front movie is false. And it will not quit when done. If I say, set auto quit when done of the front movie to true, then it will quit the QuickTime player when it's done.
The same applies for close when done. You can set the controller type to a specific kind of controller type. To none, or to VR player, or whatever you need. You can get the current time of the movie. You can get the dimensions. You can get the duration, fast start. You can get the href. So this is what those droplets use to go in and set the movie. And you can see that they're quite extensive in their variety. Now, a movie is composed of tracks. Well, tracks also have a collection of properties involved with them.
From whether it's an audio sample rate, or whether it's a language, or what kind is it. Is it a video grayscale? What are the natural dimensions of that track?
[Transcript missing]
is showing an example of three of the new features that are part of the QuickTime dictionary. So let me go back here for a second and pull that dictionary back up again. What's the recent items? Okay. And one of the new events is enter full screen and exit full screen.
We have the ability to auto-present a movie. So you saw previously when I did click the link in the web page that the movie went full screen and then presented itself and then closed off. But you can actually see the movie loading in. You can actually see the file open up and then play.
For smoother presentation, what we've implemented in the new version of QuickTime with these two commands is the ability to first set the monitor to a color, just a plain color that you want, whether it's white, black, red, chartreuse, teal, whatever you like. And then we load the movie in behind it and then present the movie.
When the movie's done, we close the movie, bring up the next one, play that, then close that one, then bring the screen back to normal. So this enter full screen command can... comes in very useful when you need to present to somebody who's got a wallet that has money in it.
See, I always think about how AppleScript's used in money, you know? In terms of money, because I used to write scripts for a living. And all of this technology has now been built, that command's been built into the new version of the present movies script. So some of the new abilities are presentation.
Do you want it full screen? Do you want it double normal? Do you want a continuation dialogue? Do you want it to loop? Do you want to set the volume? And what kind of background color do you want to apply to it? So I'll set some of these preferences. I'll let it go full screen.
I'll leave the default volume. Should it play? No continuation dialogue, no looping, and I want to set this background of it to white. So you can see that that's been applied and saved into the script. Now, when I drag... Since we're programmers here, I'm going to drag these two onto the script.
You see it go full white first? You didn't see the movie load? It happens very fast and very smooth. I had everything set up on Windows. I had my whole life on that machine. You know, my illustrations, my writing, my banking. You know, it's like being stuck in a relationship. My fiancé knows him. It works on some level. So now you know somebody that knows somebody that knows him. Okay, well let's watch when this closes.
Closes, screen, new movie, comes in, smooth. We decided to try to upgrade. We were lured by the iMac. Then we looked at the operating system and said, wow, this is possibly the best operating system I've ever seen. So I was expecting to see 3,000 guys looking at him here. Imagine my surprise. It's not just for artists. It's not just for pointy-headed intellectuals from California. Yes! It's for us. It's for developers. This thing is an all-around computer. I can use this for everything. Now watch it close. I'm a programmer. If I try it.
Then back to normal. Nice. Let's thank the QuickTime team for putting that in there for us. Another new feature that they inserted into the new version of QuickTime that's very useful, especially for those that actually know what they're doing, is this thing called a matrix. Anybody here familiar with matrices? Grumble, grumble, couple people, yeah, yeah, cool. Couple people, algebra, I hated it, I hated it, I hated it.
It's like where you have three numbers, and then you have three numbers underneath that, and then three numbers underneath that, and you change these numbers, and somehow it does something. They have it in Photoshop, and I've opened up images and just typed in numbers and watched them go, grumble, grumble, grumble, and then you can't get them back, and you know, Aunt Louise has a carrot growing out of her nose, and it gets weird. So, they've opened up the ability for us to set and get the current matrix for a movie. So, what I'm going to do is open up a movie.
And what I'm going to do is go in here and choose Get Movie Properties, Video Track, Size, Adjust. So the first thing I'm going to do is just grab this here. You click it once, and then I'm going to just kind of skew it a little bit like this. So I've actually changed the movie. The movie still plays like this, but now it's been altered. And this has been altered to a mathematical calculation involving a matrix. So I'm going to write a script, tell application QuickTime player.
To get the current matrix, can you see that? Of the front movie. Don't you love this heavy programming stuff? And if I run it, you can see that down here at the bottom, we have an AppleScript list of three numbers corresponding to the top numbers, three numbers corresponding to the middle numbers, and three numbers corresponding to the bottom numbers. That's the matrix of this movie.
And then if I go into the movie and I again do some more things to it, like I'll grab the rotationable, rotate it like that, and then run the script again, You can see that the value here changed. So you can literally go in and use AppleScript now to morph your movies into any kind of way that you want to. And this is available to you. I forgot to turn it off, okay. And there's a script in the QuickTime player collection called XMiscellaneous, set matrix of the front movie, and we've included a couple just by default. Horizontal squeeze, where it slightly squeezes the front movie. - Ooh.
Go back to that, miscellaneous, matrix of the front movie. Make it back to normal. Let's see normal. And don't worry about hurting your movie, because the movie actually knows what it originally looked like. And you can really muck it up in it and get it back to normal. You can even make it look like a flying card, you know? It doesn't freeze. It's Superman.
Everything just works. It just works. Unfortunately, my dad-- So I'm interested to see what kind of mathematics some of the guys out there who really know what they're doing with this kind of thing can do with movies, maybe turn them into Krispy Kreme donuts or something like that with weird centers and things like that. But that's another second feature involved in the new QuickTime player.
The third feature, the third new feature that I want to talk about is-- A very important one that's been a wish list item for everybody for quite some time. Now, you'll notice that under export, we've always wanted to use the incredible engine that's built into the operating system of QuickTime to do compression. You might not know this, but all the compression tools you need for really doing good quality compression are built into the QuickTime architecture and can be accessed from the QuickTime player.
And naturally, since they're scriptable, you can use those to batch process some export of items yourself. And until now, until the most recent version of QuickTime, you would have to say using a settings preset, which was one of these things. So if I open up Dave again, and I choose... You had gotten so disgusted with the machine. Dave got so disgusted with me, I had him set to autoplay and present, didn't I? So if I chose export... - All right.
These settings here, I could use default settings, most recent settings, or something that was pre-named. We didn't have the ability in AppleScript to go into the options and really get at all the various settings and get into details. And we couldn't set those on the fly like we wanted to, to be able to do some very sophisticated batch processing. So what they've implemented in the new QuickTime player is the ability to actually save an export setting.
Now, these settings get saved to a specific kind of file that only QuickTime pays attention to. You can't open it up into BBEdit and play with it. But what you can do then is save off your favorite set of settings and then use those settings when you want to batch export. So you could have 20 different settings for just audio. You might have a set that really worked well for classical stuff. You might have a set that really worked great for jazz. Or you might have a set for video that you like a certain way.
And now all of those are available to you using the save export command. And the way you would do that is you would say save export settings for the front movie, for perhaps MPEG-4, to a file location. And you always want to do this. You always want to, first of all, set up your settings.
So I'm going to go options, MPEG-4. I want video to be here. Ding, ding, ding. I want that like that. Ooh, this is going to be ugly. Like that over here and about there, okay? And then I go okay, save, and then start the export and then stop it.
What that has done is that's set into the QuickTime player, those as being your most recent settings. Now when I use the command in AppleScript to save export settings, I'm actually saving those settings. So yes, it's going to take you maybe a couple hours to set up all a batch of your favorite settings. But once you do, you can do cool things with it. And so I'd like to bring up now. Ryan Lynch from the QuickTime team is going to demonstrate this tool that he created himself to use internally and with some clients. Thank you, Ryan.
Can we have demo two, please? Oh, yes, demo two. So part of my job is dealing with production of streaming media. And so it's terribly tedious and repetitive if you don't have any tools to take care of it. So what I've done is use a lot of the scripts that we have.
Demo two. Thank you. Some of the things that Sal came up with before and tweaked them a lot and helped to really automate some of the processes that we have to do. So taking off on the saving this export settings, I have a fun little tool that I wrote here called QuickTime Compression Helper.
And so, you know, I've got some nifty AIFF files and I want to actually do a batch and code of these things. So if I were to open it up in QuickTime Player, we'll go through this whole thing and set up the, I want to export to a QuickTime movie perhaps with... AAC is awesome, so we'll do that.
And good enough. So, okay, so if we were to export that to desktop, go. So now, if I were to run this, I can just say, save my QuickTime settings. Because I just did the QuickTime movie, so let's save the QuickTime movie settings. You can save any of the settings for 3GPP, which is new in 6.3 QuickTime, or even the hinted movie, any of them. So let's save that. I'm going to call it-- I like Bob. So, Bob test. Now it's saved it off. And if I were to grab all of these files, drag them on there.
It gives me a list of all the settings that I have that I've already saved off in my settings directory. So I can say, Bob, test in a 96K. Go. And now it's going to go through and export those two movies at both those bit rates, save them back out to disk. Really cool. So you can basically set up your own poor man's version of Cleaner, and it works very well. I actually like to think of it as the smart man's version of Cleaner. Because the nice thing is this is yours.
You customize it the way that you want. You're not dealing with somebody else's interface. You're not dealing with somebody else's rules of the game. This is something that you do that's yours, that really works for your needs and the needs of your client. And it's a tool that costs.
Rhonda, what does QuickTime Pro sell for? 29.99 and you get access to this incredible technology and compression ability. Can you get it free in a book? That's another good one. There's a QuickTime for... The web. Rhonda Stratton, Sal Soghoian Web. I thought I was going to get somebody to say that. QuickTime for the web. It also includes that as well. OK, so we got one that came out.
I think this is the last one. Okay. That's not bad. What are we doing this on? What is that? Oh, it's not a G5. How come? I want one. Okay, that's enough of that anyway, so we'll stop that. And let's take a look at what we got. So we have four new files that's created, it's exported, and I've named them with the names of the settings that I used so that you know what you've just exported. So that's kind of nifty and works pretty well. Oh, got to tell this to shut up.
And so now I've got these files, but when you have just movie file or just audio files, they don't look very pretty. So we want to--when we present these things for the web, I usually like to add a graphic onto them and let--so there's something for the user to actually see and get more of an experience. So I've got some--no, not that one, the other one.
I've got some files here that are all audio files. They're not very special. You know, they've got... They just... They're all the same, actually. So we're going to take these guys, and I'm going to drop them on my little image and annotation script. And none of them had annotations, so I like to do a whole bunch of things together and just string a whole bunch of operations into one AppleScript. Like a workflow. Yeah, a workflow. So it works very well. So we have, I'm going to set the annotations. It actually saves, this version saves the annotations that I used last time so that I can use them again, which is kind of nifty.
It's a wonderful feature, the properties, you can save everything into them. And so there we go, that sounds good. I'm going to choose my graphic file. Hey, that looks good. Go for it. So I'm just copying and pasting it in there, and boom. Done. So now, if I were to open this up, it sets auto, I guess that one sets autoplay too.
So you could actually have a series of images and have a slideshow going along as that's playing too, just with images you get of the group from the web or whatever as well. Great use? Yeah. Excellent example of a simple workflow put together with AppleScript and the tools of the QuickTime player. Thank you. My pleasure. Appreciate it.
So the next thing, can we go back to laptop one? Laptop one. So that's some of what's in the QuickTime scripts. If you actually delve through there, there's a lot more involved and there's a lot more that you can take advantage of. Due to time constraints, we're going to move on to some heavier hitting things.
This year for Apple and the last year for Apple has been a tremendous year of innovation. And as Steve said a couple years ago, when he was asked a question about the economic slump, he said that Apple plans to innovate its way out of the slump. And we've been doing that as witnessed by some of the materials and things that you've seen at this show.
So one of the key things that we were able to do that we introduced a while ago was AppleScript Studio. What AppleScript Studio is, it's a peer development language to Objective-C, Java, and C, uses the same tools, development tools that all those other languages use. And now at this series, at this conference, we introduce the culmination of the original work that we did with Project Builder, and we introduced Xcode.
And I've just opened up Xcode here. And AppleScript Studio is actually a component of Xcode. It's part of Xcode. And what it lets you do is it lets you develop real applications for Mac OS X written entirely in AppleScript, partially in AppleScript, or a combination of AppleScript, Java, C, Carbon, Cocoa, whatever you want.
You put it together and it's yours and it looks like a Mac OS X app because it is a Mac OS X app. And one of the neat things about this and one of the really innovative things about this is the crosstalk now between languages. AppleScript can now communicate directly with any system API or any framework, including the QuickTime framework. I'm going to launch this little app that's on my desktop here called the Movie Player. So what this will do is I'll just do it and you'll watch.
Watch it fade. Ooh, did you get it? Wait, it faded in? I'll run again. I'll run again. I found a new property. See the way the movie faded in? Ooh. It's going to fade out. Now, interesting thing about this movie-- I get to fade it in one more time.
I like my toys. I'm going to stop it. As this movie player application has some commands, I can rewind. I can play. I can stop and I can set preferences. So it has a series of preferences that I can set for auto-play, auto-quit when done, do I want to hide other application windows when I launch this application, and do I want to fade the movie in and out.
And this is a native Mac OS X application. I've created my own movie player application. And like any other Mac OS X application that's created, it has a bundle. It is actually a package of things. And if I open up the contents folder, resources folder, there's a folder in there called movie. And I can literally just take this movie out and drag in another one. I won't take that one. I want something more. Give me Momoko. Yeah, there we go. And I'm going to close that and now run the app again.
[Transcript missing]
Because like the QuickTime guys, we got our own address. And click the AppleScript Studio button. And there's a project down here that's called Movie Player Project, and you can download it and actually use this. And I'm going to open that project up right now into Xcode. And you do that by just clicking the blue kind of file.
And this is Xcode, if you've seen it demonstrated throughout the conference so far. And we live in this project, we live in this environment too. This is our environment just as much as it is Objective-C, Cocoa, Carbon, any other language. This belongs to AppleScript too. We are peer development language now on Mac OS X. Rhonda Stratton, Sal Soghoian And as you can see, the MoviePlayer project contains a scripts folder, which will contain the scripts for our project.
It contains a resources folder, that in this particular case contains a movie folder with my movie in it as well, icons. Rhonda Straatton, Sal Soghoian And you'll notice that there's a frameworks folder. And one of the things that are in the frameworks folder, let me open this up a little bit here, is I've loaded in the QuickTime framework.
Rhonda Straatton, Sal Soghoian So AppleScript can tie in to the QuickTime framework. Rhonda Straatton, Sal Soghoian And you'll notice that there's a frameworks folder. And one of the things that are in the frameworks folder, let me open this up a little bit here, is I've loaded in the QuickTime framework. to the QuickTime framework directly, you can write your own commands to do this. So what I'm going to do is, for example, I'll open up the AppleScript script itself, I'll just double-click it.
And this is the AppleScript script that's in there. I'm going to set this for editing out of a single window. And it has a lot of documentation built right into the header, so it tells you how to use this. And it tells you about some of the QuickTime calls that are available to you and documents each one of them. But I'm going to just jump to where the script is. So this is actually the script that makes up this particular application. It has some handlers for what it does when it launches.
It has some properties that it stores and writes to a preference file like any other Mac OS X application. And it has routines for loading the movie, what it will do when the movie is finished launching, what the application will do once it's finished launching. And then it has an idle handler right here that the application will watch and determine when the movie is finished playing. Well, that's not a command that's readily available to AppleScript. There's no "Is movie done?" playing command built into Xcode at this point. So how did we accomplish that? Well, we did that by tying into one of the QuickTime APIs. We created a little routine for ourselves here.
And it ties into the QuickTime API. This is a little Cocoa thing here. It's a Boolean value, meaning true or false. This is the name of the routine I've put together, isMovieFinished. And here you can see it's actually calling into the QuickTime API. An API call that they have is called isMovieDone.
It returns a value of 0 or 1, true or false true, depending upon whether that movie is done. And you pass it in the QuickTime movie that you're going to be examining. And all of this can be found. You can go find and... Is movie done? It's too fast for me here.
It's in the movies.h file right here. So this just went into the QuickTime.h file, and you can see that here this was put in in version 10.0 and later, Carbon 1.0, QuickTime Live 2.5 and 3, and here's the, oh, it moved it on me. Natural bounds, wherever it went to. It slid around. But you can see it takes you right into the QuickTime headers, and you can actually see all the calls that you can make.
And the way that it's called in the AppleScript application is this particular thing called call method. Then you give it the name of the method with any parameters that you're passing through. So at this point, AppleScript leaves its world, calls into the QuickTime frameworks, has it do something or return some information, and then gets that information back and then proceeds. So it just leads on with it. Now, this sample project that's up on the website contains a library here. Let's just go right to it. I'll show it to you. .h file.
Oh, that's the wrong one. .am file. And then switch over to the thing. Here are some of the calls that are available in this little sample that we have in this project. Getting the time value for a movie, setting the time value, getting the duration value for a movie, getting the time scale, the bounds of the movie, the natural bounds of the movie, rewinding the movie, going to the end, is the movie done, what's the bounds of the main screen, and setting the volume for the movie. This augments the abilities of AppleScript Studio as it is right now.
And it's a great example of how to expand your work beyond the normal scope that you've been able to do with AppleScript. Instead of waiting for a scripting edition to be written by a third party that you have to make sure is installed on every machine, you can now just call the calls directly yourself through AppleScript Studio and create a visual interface that determines what the user sees. As part of the project, of every project, this particular application has a nib file, an interface builder.
And this is the interface builder. Let me hide all the other stuff so you can see. This is the preferences window. Here's the application menu. This is the floating window, and it has certain properties involved with it as far as how it's designed to expand. And the movie view that's inside of that window that I have stretched to fill it is also set to expand so that when the movie's placed in there, AppleScript asks for the size of the movie from QuickTime and then tells the window to size yourself automatically to these dimensions, and naturally the movie goes to that dimensions, and then it shows it. All of that put together inside of AppleScript Studio. Brave new world. You have a lot more abilities than you ever had before. And it's all available to you on Mac OS X, Jaguar, and Panther with Xcode moving forward.
So that's just a quick overview of some of the things that you can do with AppleScript and AppleScript Studio and QuickTime and some of the resources that are available today. Small things and big things. So with that, we have a few more minutes. I'll be glad to take some questions. Do I have an assistant on the questions here? Ah, okay. Thank you. Nope. So I guess I'm the assistant on the questions.
So quickly, we'll go through the upcoming roadmap. And as we're doing that, please line up at the microphones if you have any questions for Sal or Ryan, if you have any. Here's the roadmap of upcoming things. There is a QuickTime alternative programming environment, which obviously we just had a big lesson on that.
And if there's any questions on who to contact regarding anything to do with QuickTime, it's Guillermo Ortiz. He's at QuickTimeMan at Apple.com. Reference library, Sal pretty much told you about all this stuff. And don't miss, there's a lab downstairs, open every day, where you can talk to engineers about anything you need to do. And there's also a content creation lab about creating content.