---
title: WWDC2003 Session 718
framework: wwdc
role: article
path: wwdc/wwdc2003-718
---

# WWDC2003 Session 718

## Transcript

Kind: captions Language: en let's get the whole view here right I got this shirt in Hawaii I just came back from the geek cruise does 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 Mac mania 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 made sense I don't know how it worked thank you for spending time today and coming in for the Apple scripting 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 scriptures in here i see by the disparity in difference there that our scriptures that want to start incorporating quicktime into their lifestyles is this true nugget right there there's one right there he just got a cable modem he wants to live the quicktime life I due to all the time I think the story of Apple scripting quicktime is a one of the real unsung success stories in apple computer and through the very diligent hard work of Gary Flynn Tom Becker rona Frank and and everybody involved in this it been an ongoing process is just loomed and bloomed in bloom and it basically came down to the same idea that affects every businesses 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 in the applescript team focused on delivering core functionality that allows you to automate a lot of the repetitive things that you do with QuickTime content such as you know applying annotations to 400 movies that you're 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 get 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 talking 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 it 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 reef most recent version of quicktime just for apple script just for apple script you're very special there are three extremely powerful features that can only be done with apple script 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 Apple scripts to do which is part of the Xcode package and what that allows you to do is create a native mac OS 10 application using Apple script Objective C Java Sea or any combination thereof but what we're going to particularly pay attention to with Apple scripts to do is the ability to talk directly to the quick api's 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 it's the shortcut that the people into no use you can do the same for Apple script as well as Apple script calm and I've down the right-hand side you'll see a thing 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's it turns on a lot of functionality that you really want to take advantage of and one of the links there number 10 is apple script which will take you to a page within the applescript world that contains scripts about the quicktime player if we want to get to the same page via Apple script you just type in dub dub dub apple.com / applescript or applescript com click the applications button navigation bar click on the quicktime player and it takes you to the same page now this collection that we post is over a hundred in what's about 150 script 160 last time we looked right there were some other additions in there these are every script it's posted on here is fully editable you can open it up steal the code change the code bake the code squeeze the code whatever you want to do with it we encourage you to open up these scripts and look at them they're not only usable tools as they are but they're really jumping off points for going farther with apple script there's a collection of athlete in applets apple script athletes which are self running applications with an icon that looks like this and apple script droplets which look like this was a nice little blue arrow on it and these are the kind of scripts that you drag files on or folders or files on all of our app all of our droplets are designed to handle multi-layered folders of quicktime content so if you have a folder of 50 movies with other folders of 50 movies just drag the whole thing on there and the script will parse it for you and recurse through each level doing the process that it's designed to do and some of the applets and droplets that we post include things like as simple as adding to favorites making a quick way to add something to a favorites being able to set the annotations of a movie every annotation that's available and here's a list of all the possible annotations that you can set and you can have a script that's preset to your specific set of annotations or you can have a copy of the script for 10 different kinds of settings and just take a movie dragon on it it will open up the movie apply the settings for you and close the movie back so it's just a quick drag that saves you about 10 minutes of work by yourself there's a applets and droplets for clearing the annotations converting droplets for converting to QuickTime streams click on format you can create slideshows from folders of images display a particular folder as a slideshow just to get a quick idea of what it's going to look like if you just want to do a quick set of annotations you could use the limited annotations droplet and go to the comment field in the finder on the droplet and set a couple properties and i'll be demonstrating that one for you as well there's also applications and droplets for automating the playback of movies and presenting movies full screen those are very useful if you have a dozen movies and you want to just play them and sit back and watch you drag the folder or just drag the files onto the script and it will open them up one by one and present them in the manner that you indicate whether it is full screen double size or normal size whichever way that you want there's also a version that you can place the playback script in the folder with the movies run the script and it looks around itself find some movies and presents those as well there's a script for sampling an audio CD and you'll see that today there's scripts for saving things as uneditable so once you've got that file the way that you want and you don't want anybody else going in you can just quickly drag it on to that and post it up where you want it becomes a nun editable file saving is hinted saving a twit time for Mac you could actually control the QuickTime playback on machines remotely using program linking in this script you can set controller types setting the a href property of a movies always been something that people like to do but it's been difficult to do and with this droplet you just assign me the URL of the movie that you want and drag it on we'll look at that then there are the playback properties droplets and these control the hidden features like auto clothes so that a movie when it's done playing closes up after itself or Auto quit so that when the movie's done it quits the QuickTime Player or it will automatically go into presentation mode full screen for you you might not know that these features are there but you can set them with applescript that's just a droplet and it really makes a difference in the way that your customers and your consumers of your content get to view the content and we'll look at those as well then those are our self standing self running scripts the other hundred scripts that we have in this collection our script manuscripts and they're designed to be run from Apple system level script menu now this script menu is installed in every copy of Jaguar you've just done extra jagwire did I actually do that it's infectious isn't it it really is this script menu is installed in the Apple script folder which is in the Applications folder you just double-click the thing that's a 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 it by default it has dozens and dozens about 30 or 40 scripts pre-installed for you and when you download the script collection you can get the QuickTime broadcaster scripts and the QuickTime Player scripts and this hundred 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 a 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 helps save some time for example one that was that this was one of Rhonda's big when she came to me about this one says Sal we have to automate this and it's chapter creation instead of creating text files with certain coatings 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 of selection to a new movie edit a frame and 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 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 then 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 will 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 the HTML for a QuickTime embed tag this actually walks you through it it looks at the front movie and analyzes and ask you a couple questions about what you want to do with it and then writes the embed tag for you will 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 the source URL so the front movie if you're interested in where streams coming from some miscellaneous ones here's a very useful one that will be demonstrating is 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 it's a script that does it very easily for you there's some other navigation scripts someplace Crips some previewing scripts some property scripts and these are setting the specific playback properties like auto quit when done auto close when done autoplay playback properties in general hrf of the front movie there's a couple scripts dealing with smile FM IL 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 serious 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 interesting script for settings 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 your anal retentive lightning 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 see 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 oh nice okay let's just drag it up to be here the readme files 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 your detailed description of each one of the scripts that will be dealing with there's installation instructions that tell you you know where you're going to put the files of what you're going to do with them what kind of requirements you have for the scripts and then there's so the collection of scripts themselves the applet 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 then 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 in all of the error handling and repeat routines and everything else has already been done for you I know I'm rolling you over with all this stuff right there as the collection of QuickTime Player scripts which is 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 will be looking at in just a little while so let's begin by looking at some of the athletes 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 there 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 ok ok 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 and let's 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 there everybody else in the world out there at large gets enjoy this as well here's our applets collection and there's the add to favorites annotations drop at 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 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 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 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 four T's 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 use of performance with me myself and i so to set the annotations to a movie i just drag that movie on to the droplet it opens up the movie applies to 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 applied the annotations for you automatically now that's not so impressive with one movie but it's very impressive with 300 smallville starting small we're building here okay we're going to take that same movie now that it has that applied the annotations applied to it i'm going to drag it on to 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 destination destination create and choose that so it will open up the movie and then extract all the annotations create a credit that goes in front of the movie and then save it off now this is useful for if you if you're reviewing content and you know you can't keep track of every movie that you've seen 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 most impressive very very impressive play golf klappa like that very societal oh these guys are great Tara Tina is nothing on them and then it plays up for copyright and then the movies up voila monochrome badal ah so critical SP is nothing at all someone that you email ok so there's an example of a script that builds upon something else that another script did but that way you can take now take that movie and give it to somebody else who's not familiar with your organization in your material and they instantly have all the information in front of the movie and it took me all of what how many seconds to do it little things like this make a big difference during the day and let's look continue to look for some of our other examples here display a folder as a slideshow this is useful open quicktime scripts here go to my examples files and i'm going to choose 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 you know quickly browse through a folder of images to see what I want that abilities 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 well that's a quick way to do an entire folder is as a set you can also there's another parent pair to that one where you can save the entire folder it's 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 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 well that Romero chrome / switch all right i'm going to double-click the script because all of our scripts can be set their preferences that can be stored so the presentations normal size continuation dialogue now what is the 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 with guys internally at Apple we're used to be shows and they go oh ok I got to stop and he stopped up 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 you want to go to continue and that's an option you could say I want to display the movie at normal size and bring me a continuation dialogue okay so let me just 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 on to the play movie script now these you can keep in your dock as well just have them there all the time ipod ipod dear XO iPods the Dodger games two and then you gotta pass them down kind of the way they sell hot dogs I got about fifteen hundred in the trunk of my car I'm usually shirtless just for a fact the money that starts flowing in can listen all these songs I say at least over 50 songs I'm not quite sure the amount i think it's like two million songs my name is Will Ferrell and I'm a porn actor so it closed is it brings up the continuation dialogue Christmas and then does the next range are I saw Moloch so I'm going to just say 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 you know series of movies again that you want to be able to just present how do you do it what do you do line them all up in the movie player and then click click click click or play all movies and they all start gorda or whatever oh I'm Will Ferrell no I'm Walter oh 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 going to drag them on to auto clothes and now wills ready to go and so while i'm adding the drag will onto autoplay and now play well christmas songs the dr santa crazy are I saw Mommy Kissing Santa underneath the Christmas tree the Jingle Bell Rock white Christmas we're getting enough I've heard that over a billion times yes Santa has an ipod and playlist 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 do you notice the movie closed on its own nice way to present 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 little example things and where Francis Valli rally ok 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 dot 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 is this file and play it in the quicktime player so a simple click on this opens up the movie and then closes it nice way to present a movie from a web page isn't it or from the help page the user doesn't have to know anything about controls or about how to manipulate the play or anything else all they have to do is just click click ok click reload click all the quicktime player that's because i had pants are installed on the other stupid partition earth been bugging me all week ok hold on so click so this movie 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 ok going to continue on there is the auto quit property autoplay 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 droplets and determine you know what time you want to have it for display and then drag it onto that to set that's a couple of the those playback properties another example where Apple scrip can really help you save some time is in media skin 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 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 a 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 la what a flood of uncha cooks I don't think any of them can actually cook so here's an example a hassle script now how Apple script can automate some of the process and take some of the sting out of making media skin 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 it's going to be cut away and there's the drag mass which is going to indicate which part of the mat 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 on to 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 and 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 ok 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 finish movie close it delete temporary items movie process 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 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 so that's only on my computer it's not on yours this will actually work on your computer leave it closed it and now launch it so that's a multi-step process thank you the multistage 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 athletes and droplets that are available for you from the website there's other ones such fate set controller type set window position save as uneditable save in various formats like copy make a copy hinted exported to a DB 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 colon slash slash dub dub dub apple.com / Apple script and that's going to be the preference for this so that when I drag on any movie on to that script and let's do this one it's not going to love expose right okay so it just set the href of this movie play come on Oklahoma da la critics lesbian something at all i wanted to email my song anybody show game if I'm on the ice Tony I want to home there it is I went right to the website so that's how you set the href for moving very easily with Apple script 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 than the dock or or someplace else and as you're working with koi pond 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 accept the annotations on this one it's just a matter of you dragging to these little tools 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 mul mul go again haha 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 oh okay it's an interesting way to go about doing it probably a more pacifist way would be to use Apple script 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 it says which chapter which tracked you want to tie the chapters truth to the audio or the video track 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 a full screen to go back to their 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 i'm going to give it a name of full shot right there click ok 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 what chapters and chapters current time and sale of wok wok wok logo she's ok so now I have chapters inserted for a full shot start logo and of course they change as the as the movies 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 or 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 in two separate DVD portions for you so you don't necessarily have to be in iMovie in order to add chapter tracks into your your 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 you know I've got the pro version I actually bought the pro version myself I must say I want to support my company I bought I bought the pro version myself you know and then I took five keys off the server and use them for other things you know but basically I did paper and all of this has been happening with the quicktime player application and it involves the process of writing script 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 to the second version has lot nicer icons and a little bit different interface here but it's basically the idea that is this is the area right here in which you write your script now I'm going to open up the dictionary or the internal commands available to us from applescript for the QuickTime Player to do that I choke 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 who 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 application they're usually a set of verbs or commands to indicate standard action such as clothes count delete does something exists 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 sweet 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 receive those action commands there's annotations and an annotation has some properties that 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 a 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 new movie open movie and new player so you can remotely have applescript control the way that the movie player on the customers machines 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 you want to show the movie in the window you want to show the Welcome movie automatically and what version of the QuickTime Player are you dealing with there are them descriptive objects themselves that make up the quicktime player and one of the first ones we're going to go to at a tire 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 write a file for a movie that you're running on a CD it has track it might have video tracks audio tracks graphic tracks any kind of QuickTime track which show up here and it has a window that the movie execute in and these are the properties of a movie and you can see that the 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 to false and it will not quit when done if I say set auto quit when done of the front movie did true then it will quit the application it will quit the quicktime player when it's done the same applies for clothes when done you can set the controller type to a specific kind of control 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 get the a href so this is what those droplets use to go in and set the various parameters of a movie and you can see that they're quite extensive in their variety now a movie is composed of tracks while 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 that a video grayscale what are the natural dimensions of that track all of these properties can be gotten or set from applescript now a track can also have a chapter and chapter has very it has a name a time that it occurs and an index also there are frames in a movie frames have a duration and index a time of value there's images and internet location the palette the RGB color recent items streams text frames track texture and we already cover tracks an event and then some of the events that are available these are some of the verbs that apply to these kind of objects that are pertinent to just quick time add can export clear copy cut enterfullscreen exit full screen export flying flip horizontal flip vertical get URL invert open image sequence open location paste play present we do we place resize we revisited rid of rotate level everything so you can see that there's a really big collection of tools available for you here to take advantage of just in the quicktime pro player that let you really shorten that what you do and the scripts that we've presented to you are ways to shortcut that process now let me take it to the another example of this and what I'm going to do now is show an example of three of the new features that are part of the QuickTime dictionary so we'll go back here for a second pull that dictionary back up again recent item template our dictionary okay and one of the new events is enterfullscreen 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 present 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 it's the ability to first set the monitor to a color just a plain color that you want whether it's white black red chartreuse appeal whatever you like and then we load the movie in behind it and then present the movie when the movie is 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 enterfullscreen command comes in very useful when you need to present to somebody who's got a wallet that has money in it so you always think about how Apple scripts 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 commands been built into the new version of the present movies script so some of the new abilities are presentations you want it full screens you want to double normal do you want a continuation dialogue you want it to loop 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 fullscreen 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 a let's see since we're program is here I'm going to drag that these two on to the script I don't see it go full white first you didn't see the movie load happens very fast and very soon and set up fun on windows I had my whole life on that machine you know my my illustrations my writing my banking you know it's like being my fiance knows if it works on some level so now you know somebody that knows somebody who knows good effort to do it within what you do it you realize you should have done it a long time ago okay watch watch when it's closed Uzi lance writer and illustrator closest screen we had done some new movie come again smooth at up with it that we decided to try it out great we were worried by the the imac then we looked at the operating system and said wow this was possibly the best operating system I've ever seen because I was expecting to see three thousand guys looking at gme everything the internet we're imagine my surprise and stunned by those it's not just for artists it's not just for pointy-headed intellectuals from California yes it's crossed its berdych pointy-headed just for developers this thing is an all-around computer I can use this for everything now watch it close I'm a programmer by trade and then back to normal night thank the quicktime team for putting that in there for it so another new feature that they inserted into the new version a 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 a couple of people algebra I hated it I hated I hated well 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 watch them go whoa no more 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 [Music] okay and what I'm going to do is go in here and choose get movie properties video track sighs adjust so well first 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 if the movie still plays like this but now it's been altered and this has been offered through 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 apple script 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 if i go into the movie and again do some more things to it like Oh grab it rotational 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 Apple script 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 X miscellaneous set matrix of the front movie and we've included a couple just by default horizontal squeeze where it's lightly squeezes the front movie go back to that and miscellaneous matrix of the front movie make it back to normal let's see normal and it 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 weird doesn't three superman just work legitimately I'm interested to see what kind of mathematics some of the 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 you know Krispy Kreme donuts or something like that with weird centering things like that but that's another second feature involved in a 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 a wishlist 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 you know 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 also discussed in the industry they've got so disgusted with me i had them set to auto play and present did night so if i chose export these settings here I could use default settings most recent settings or something that was pre named we didn't have the ability in Apple script to go into the options and really get at all the various settings and gets into details and we couldn't set those on the fly like we wanted to to be able to do some very sophisticated batch process testing so what they've implemented in the new quicktime player is the ability to actually save in export setting now these settings get saved to a specific kind of file the only quicktime pays attention to you can't open it up into BD at it 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 you can 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 dad like that who this could be ugly like that over here and about their okay and then I go okay save and then start the export and then stop it what that is done is that set into the QuickTime Player those as being your most recent settings now when I use the command and Apple script to save export settings I'm actually saving those settings so yes it's going to take them maybe you know a couple hours to set up to all Bachelor 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 was going to demonstrate this tool that he'd created himself used internally and with some clients thank you can we have demo to flee oh yes 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 tool to take care of it so what I've done is use a lot of the scripts that we have demo to that thank you some of the things that sound came up with before and tweak them a lot and and help to really automate some of processes that we have to do so taking off on the saving Nick this export settings I have a fun little tooled I wrote here called quicktime 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 will 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 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 mmm because i just did the QuickTime movies let's save the quicktime movie settings you can save any of the settings for 3gp which is new and 6.3 quicktime or even the hinted movie any of them so let's say that i'm going to call it I'd 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 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 96 k 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 actually like the think of it it's the smart man's version I really know 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 cost Rhonda what is quicktime pro sell for 2999 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 quick time for the last web I thought I was going to get some you to say that quick time for the whole web it also includes that as well okay so we got one that came out like this is the last one okay that's not bad what do you what you be doing this on what is it acos 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 we gotta we have four new files that's created its exported and I've named them what's the names of settings that I used so that you know what you've just exported so that's kind of if bein works pretty well oh god tell this to shut up and 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 on to 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 they're all audio files are not very special and I like that they're 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 annotation so I like to do this 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 annotations that I used last time so that i can use them again which is kind of nifty it's a wonderful feature you properties 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 was copying and pasting it in there and boom done so now on Phi 0 4 in court open this up that's Otto I guess that wants a bottle place it so you could actually have a series of images and have a slideshow going along as that's playing too just what 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 Apple script in the tools or the quicktime player thank you I 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 script 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 well when he was asked a question about the economic slump he said the apple of 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 it this show one of the key things that we were able to do that we introduced a while ago with Apple scripts to do what Apple scripts to do 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 of 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 Apple scripts to do 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 10 written entirely in applescript partially an applescript or a combination of Apple script Java Sea carbon cocoa whatever you want you put it together and it's yours and it looks like a Mac os10 app because it is a Mac os10 app and one of the neat things about this and one of the really innovative things about this is the cross talk 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 it what this will do is I'll just do it in lunch like it safe would you get it wait it faded in i'll run again i found a new i found a new property it's just see the way to movie faded in its going to fade out now interesting of thing about this movie i get too faded then when we're done I like my toys I'm going to stop it is this movie player application has some commands so 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 autoplay 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 the native mac OS 10 application I've created my own movie player application and like any other mac OS 10 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 is 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 when I want something more that's mean the local yeah we go and I'm going to close that and now run the app again final Columbus Allah just critical SP as I make it all come on at any email or hide song so I can now control the way that Matt movie is played to my client I don't have to worry about quicktime player or anything else I've made myself my own little movie player app that controls the way the movies presented and displayed now this app was created entirely in Apple scripts to do you can download this entire project today from the applescript website i'll take us right there and you can go applescript calm because like a quicktime guys we got our own address me and click the Apple scripts to do 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 X code is you've seen it demonstrated throughout the conference so far and we live in this project we live in this environment to this is our environment just as much as it is objective c Coco carbon any other language this belongs to Apple script too we are a peer of jet we are pure development language now on mac OS 10 and as you can see the movie player project contains a scripts folder which will contain the scripts for our project it contains the resources folder that in this particular case contains a movie folder with my movie in it as well icons 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 so Apple script can tie into 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 Apple script script itself just double-click it and this is the Apple script 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 I'm going to just jump to where the script is so this is actually the script that 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 rights to a preference file like any other Mac os10 application and it has routines for loading the movie what it will do when the movies finished launching what the movie what the application will do once it's finished launching and then it has an idol handler right here that the application will watch and determine when the movies finished playing well that's not a command that's readily available to Apple script there's no is movie done playing command built in to trot into Xcode at this point so how did we accomplish that well we did that by tying into one of the QuickTime api's we created a little routine for ourselves here and it ties into the QuickTime API is the little cocoa thing here it's a boolean value meaning true or false this is the name of the routine I've put together is movie finished and here you can see it's actually calling into the QuickTime api and api call that they have is called is movie done it returns a value of zero or one true or false true depending upon whether that movie's done and you pass it in the QuickTime ah the QuickTime movie that you're going to be examining and all of this can be found you can go find and not here I want to go up here find find in project no none yeah in frameworks I want to find word done and sign it is movie done up too fast for me here it's in the movies dot H file right here so this just went into the QuickTime dot H file and you can see that here this was put in in version 10 oh and later carbon 10 quicktime live 2.5 and 3 and here's the it moved in on me natural bounds wherever it went to let 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 in the applescript application is this met this particular thing called call method then you give it the name of the method with any parameters that you're passing through so what this point applescript leaves this world calls into the quicktime frameworks has it though do something or return some information and then get that information back and then proceeds on with it now this sample project that's up on the website contains about contains a library here which just goes right to it i'll show it to you dot H file oh that's the wrong one IM 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 bounce 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 Apple scripts to do 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 Apple script instead of waiting for a scripting addition to be written by a third party that you have to make sure its installed on every machine you can now just call the calls directly yourself through apple scripts to do and create a visual interface that determines what the user sees as part of the project of every project this particular application has a a nib file in 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 on site and inside of that window that I have stretched to fill it it's also set to expand so that when the movies placed in there applescript asks for the size of the movie from quick time 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 with inside of Apple scripts to do brave new world you have a lot more abilities than you ever had before and it's all available to you Mac os10 Jaguar and panther with Xcode moving forward so that's just a quick overview of some of the things that you can do with Apple script and Apple scripts to do 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 okay thank you so I guess I'm the assistant on the question [Applause] so quickly will go through the upcoming road map and as we're doing that please line up at the microphones if you have any questions for sale or or Ryan if you have any here's the roadmap of upcoming things there is a quicktime alternative programming environments which i 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 a gear more GMO mark Ortiz he's at quicktime man at apple.com reference library shall 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 content creation lab about creating content you
