|Page (1) of 2 - 08/05/05||email article||print page|
End Jumps in DVD Studio Pro, Part 2Using scripts to jump to the last viewed menu
So this time around I'll ease you into scripting with a couple of incredibly simple scripts that do nothing more than determine which menu the viewer last accessed and then return the viewer to that menu when the track, chapter or story has completed. Now, this isn't necessarily the best method for doing this, but it is an easy one, and it will give you a decent introduction to setting a GPRM with the current item and jumping back to that item--two critical functions for you to understand when you tackle more complex scripts. (As a side note, we'll get into one such complex script next time around when we look at a method for returning to a menu and highlighting a specific button when we do so--all using math and simple commands so that it's completely dynamic.)
For this particular exercise, it doesn't matter how many menus, tracks, stories or chapters your project contains. You'll need to create just two scripts, each containing just one command.
Creating the menu prescript
The first script in our project will be used to determine the menu that was last viewed before the viewer selected a particular track to watch. The reason we have to do this is that, in scripting, you can't just create a command that says something like "Go to the last menu viewed." You first need to create a script that stores the numerical equivalent of this menu; then, in a second script later on, we can say, "Go to the DVD element that has a numerical value equivalent to the one we stored previously." Well, something like that, anyway.
Now, in order to store this information for later retrieval, we'll create a script that will be used as a prescript for all of our menus. No matter how many menus we have, this one script will work for all of them. (You have to love the simplicity of that.)
So, to begin, create a new script (Project > Add to Project > Script). This will be called "Script 1" by default. We'll rename it "Menu Prescript" just so we don't get it confused with our second script later on. To rename a script, select it in the Outline tab, hit the Return key on your keyboard and type the new name.
Now double-click the script to open up the Script Editor. Select the default "Nop" command in the script editor. When you do this, the Inspector palette will change to allow you to modify the command you've selected. Change the "Nop" command to "Set GPRM."
Then, below that, switch the Source Type from "GPRM" to "Special."
And, finally, set the Source Value to "Current Item."
The effect of this, when the script is run, is that the current item's numerical equivalent will be stored in a little memory bank called GPRM 0. Now I should mention that, generally, "Current Item" is only useful in a prescript, and not in a regular script. This particular script will be used as a prescript, so it'll work fine for our purposes here. I'll show you how to set this up as a prescript in the final section of this tutorial. But for now, we're done with our first script, so it's time to move on to the second.
Related Keywords:apple dvd studio pro, end jumps, scripting, menus, prescripts
Source:Digital Media Online. All Rights Reserved