(A George Script For Aura)

Written By J.L. White


The nice thing about the George language in Aura is, that it allows you to save time on things that shouldn't take time in the first place. What? Well every one has their own ideas of what a program should do or not do and many times that differs from what the programmers think. But with an option like George, it allows you to customize a program the way YOU see fit.

Recently a buddy of mine (Don Ballance of Newtek) called and said "Hey Jeff, I really need a script to save me some time on duplicating layers! I have a video layer and created a number of text layers that I want the same length. Can you make a macro that will do it automatically?" Well Don, my friend, "Yes I can!". The following, is a script to do just that.

This is what the script does. It looks at the first layer in the project, determines how many frames it has, then takes all the other layers beneath it and increases or reduces the lengths to match that of the first layer. Say for example, you just brought in a video clip. You create a new layer with one frame and type in some text and stamp it down. Now you load a brush in, create a new layer with one frame and create a drop shadow of the brush on yet another layer. When you run the script, it will take the text layer, the brush layer, and the shadow layer and stretch them out to match your video layer. "Yes, but I could do that by hand!" Sure you could, but not with one click! Thats the point! You would have to first make the text layer an anim layer, then stretch it out or add frames, then do the same to the brush layer, then do the same to the shadow layer. With this script, all you do is click on it, and it does all of that for you in one easy step. Thats the beauty of George, it does not do anything new, just easier and quicker!

You can go to the bottom of the page from here and click on the link to download this script, or follow along now as we break down the script, to show you how it does what it does. The acutal script is between the start and end George script lines. My comments will look like this < --- Comment Goes Here --- > and are not actually part of the script itself.

< ---------------------------------- Start of George Script ----------------------- >
// Duplicate Length
// By J.L. White
// (C)2000 Visual Inspirations Inc.
// For Don "The Man" Ballance
< --- The first 4 lines are just comment lines. Anything that starts with // is a comment --- >

Param none
connect Aura Commands
< --- Tells Aura what options to use, like rectangle, circle, for this we need none --- >

tv_LayerGetID 0
parse result FirstLayer
< --- Use this to get info on 1st layer and set the results to "FirstLayer" --- >

tv_LayerSet FirstLayer
< --- Set the current layer to work with to "FirstLayer" --- >

tv_LayerInfo FirstLayer
parse result LayerDisplay LayerPosition LayerDensity LayerName LayerType LayerStartFrame LayerEndFrame LayerTable
< --- Get information about "FirstLayer" and parse it into variables we can use --- >

CheckAnim = CMP(LayerType,"IMAGE")
if (CheckAnim == 1)
   tv_Warn "First Layer Must Be An Anim Layer!"
   exit
end
< --- Checks "FirstLayer" to make sure it is an image sequence and not just a single frame --- >

NumSelectedFrames = (LayerEndFrame-LayerStartFrame)
< --- Set variable for the Total number of frames in "FirstLayer" --- >

i=0 < --- Inititalize variable --- >
do
   tv_LayerGetID i
   i = i+1
   MyID(i) = result
   tv_LayerSet MyID(i)
   tv_LayerInfo MyID(i)
   parse result LayerDisplay LayerPosition LayerDensity LayerName LayerType LayerStartFrame LayerEndFrame LayerTable
< --- Sets current layer and gets info about it --- >

   NumSelectedFrames2 = (LayerEndFrame-LayerStartFrame)
< --- Set variable for Total on new layer--- >

   if NumSelectedFrames2 != NumSelectedFrames
< --- If already the same length, skip this else do it --- >
      CheckAnim = CMP(LayerType,"IMAGE")
      if (CheckAnim == 1)
         tv_LayerAnim
      end
< --- Make sure it is an AnimLayer if not make it one --- >

      tv_LayerStretch MyID(i) END (NumSelectedFrames-NumSelectedFrames2) LAST
< ---Actual command to stretch layer --- >

   end
Until (CMP(MyID(i),"none") == 1)
< --- Keep doing it till no more layers --- >

< ---------------------------------- End of George Script ----------------------- >


Click Here to Download DupLength.zip


Well that does it for this one, till next time...


To contact Jeff White you can E-Mail him at jeff@vionline.com

Back To The Tutorial Page
Copyright © 2000 Visual Inspirations