Automate Director

From Director Online Wiki
Jump to: navigation, search

Introduction

Director doesn't provide for the production of artefacts (shockwave, projectors or protected files) in an automated way.

It doesn't sport neither a "building work flow" or a command line interface to allow one to design our own work flow.

So the only option for automate Director is with tools that allow the "control" of applications. This is naturally 100% platform dependent.

Windows

In windows, there are some "tools" that allow the communication between processes. This can be done with support of standard windows API and within the differences existing in the several windows versions, this ability is sound (even if hard to come by).

There are some "macro" tools that allow for this, in a transparent way, and relieving the Director developers of the need to tackle with the idiosyncrasies of such API.

One of the best is (which not only is powerful, compatible with Windows Vista and is free):

To install it, just download the latest version and run the installer.

The sample test script used:

Run("C:\Program Files\Adobe\Adobe Director 11\director.exe")
 
WinWaitActive("Adobe Director 11")
 
Send("{ALTDOWN}")
send("x")
Send("{ALTUP}")

And what you know... IT WORKS! It opens the xtra menu...

This will allow the full building anything with director from an Ant script, allowing for an improved building cycle (and fully automated one at that).

; Automate protection with Director and AutoIT
; This script implies that temp2 directory is empty
; and temp1 directory only has the files to protect.
 
; Call Director (change path as needed)
Run("C:\Program Files\Adobe\Adobe Director 11\director.exe")
 
; Wait for it to start
WinWaitActive("Adobe Director 11")
 
; activate the menu
WinMenuSelectItem ( "Adobe Director 11", "", "&Xtras", "&Update Movies..." )
 
; Protection
Send("!P")
; Browse
Send("!B")
; Wait
Sleep(1000)
; Directory where the backup file will be stored
Send("c:\temp2")
; Wait
Sleep(500)
Send("!O")
; Wait
Sleep(500)
Send("!S")
; Wait
Sleep(500)
Send("{ENTER}")
; Wait
Sleep(500)
; The Directory where the original source file is and where it will be protected
Send("c:\temp1")
; Wait
Sleep(500)
Send("{ENTER}")
; Wait
Sleep(500)
; the file name
Send("testfile.dir")
; Wait
Sleep(500)
Send("{ENTER}")
; Wait
Sleep(500)
Send("{TAB}{TAB}{ENTER}")
; Wait
Sleep(500)
; Compile!!!
Send("!C")
 
WinWaitActive("Adobe Director 11")
; Wait some time
Sleep(10000)
 
; Now quit by sending a "close" request
WinClose("Director")
 
; Now wait until closed before continuing
WinWaitClose("Director")

Mac OS X