0 Replies Latest reply on Mar 19, 2007 5:38 PM by Robert J. Johnston

    Using script to automatically arrange timeline and sceneline workspaces.

    Robert J. Johnston Level 2
      This is a simple demonstration of using VB Script to adjust panels in PE3.

      In PE3, when you adjust the height of the timeline, the height of the sceneline is also adjusted the same amount, and vice versa. You could use script to automatically adjust the height of the sceneline or the timeline whenever you switch respective modes. The script below does that.

      This is for those who are familiar with script writing and the Windows Script Host. The vb script below includes properties and methods from the AutoItX library (free download).

      Option Explicit

      Dim oAutoit, strWinText, strLastTime, lngX, lngY

      Set oAutoIt = WScript.CreateObject("AutoItX3.Control")

      oAutoit.WinWaitActive "Adobe Premiere Elements -"

      strLastTime = "start"

      Do

      ' Quit the script if mousepointer put in upper left corner (0,0).
      lngX = oAutoIt.MouseGetPosX
      lngY = oAutoIt.MouseGetPosY
      if lngX = 0 and lngY = 0 then
      set oAutoIt = nothing
      Wscript.Echo "Your script has ended."
      Wscript.Quit
      end if

      ' Read the text of the window so we can determine the workspace setup.
      strWinText = oAutoIt.WinGetText("Adobe Premiere Elements -")

      ' If DVD Menu tab selected, then don't do anything, otherwise
      ' check if in Sceneline or Timeline mode.
      if instr(strWinText, "DVD Menu") = 0 then

      if instr(strWinText,"EditTimeControl") <> 0 then
      if strLastTime <> "timeline" then

      ' Reset the Edit Workspace and then adjust the timeline panel height
      oAutoit.Send "{alt}wke"
      oAutoit.Sleep 250
      oAutoit.MouseMove 1078, 646
      oAutoit.MouseDown "left"
      oAutoit.MouseMove 1078,400
      oAutoit.MouseUp "left"
      strLastTime = "timeline"
      end if
      else
      if strLastTime <> "sceneline" then
      ' Reset the Edit Workspace and then adjust the sceneline panel height.
      oAutoit.Send "{alt}wke"
      oAutoit.Sleep 250
      oAutoit.MouseMove 1078, 646
      oAutoit.MouseDown "left"
      oAutoit.MouseMove 1078,762
      oAutoit.MouseUp "left"
      strLastTime = "sceneline"
      end if
      end if

      end if

      WScript.Sleep 2000
      loop

      The script might work as-is if your screen is set for 1280 x 1024 and the Premiere Elements 3 window is maximized. Save the script in a text file with a .VBS extension, and then run it. Afterwards click on the Sceneline or Timeline buttons in PE3. It may take up to 2 seconds before the mouse starts moving on it's own. The screen coordinates were ascertained using the AutoIt Info tool.