Here's a neat trick: If you're using Panther, you can take advantage of
this new fangled Applescript feature called 'GUI Scripting'. 

This is essentially the same as many 'macro' utilities such as Keyquencer
and Quickeys, but built into the OS, and not requiring any third party
software. 

For security reasons, it's disabled by default, but you can enable it in
the 'Universal Access' pane of your system prefs - it's the cryptically
named 'Enable Access for assistive devices'.

Once done, you can automate all manner of authoring tasks such as creating
castlibs, projectors and dcrs, which are inaccessible from Lingo. The
following script (for example) will publish a DCR from the frontmost movie
(replacing any existing files if necessary).

You will need to tweak some of the strings for a  non-English OSX.

tell application "Director MX"
        activate
end tell

tell application "System Events"
        tell process "Director MX"
                keystroke "s" using {shift down, command down} -- 'Publish'
                
                repeat while true
                        
                        set dlogTxt to (value of (static text of window 1)) as string
                        
                        if dlogTxt begins with "Replace existing" then
                                if name of buttons of window 1 contains "OK" then
                                        click button "OK" of window 1
                                end if
                        else if dlogTxt begins with "Saving files" then
                                -- stay in the loop (no 'next repeat' in Applescript)
                        else
                                exit repeat
                        end if
                        
                end repeat
                                
        end tell
end tell

You can save scripts such as this in the script menu (an optional gadget
you will find in your Applescript folder) so that they are available from
within Director, you could also save your applescript as an application
and trigger it with Director's 'open' command -e.g. from a tool MIAW -
although there's an overhead involved in starting a new process.

It might be useful to use this kind of script to publish multiple versions
of a dcr in one fell swoop - or even just to increment a counter in the
filename. I think this is possible, but the 'publish settings' dialog box
seems to be constructed very strangely.

You can find out more about this feature at

<http://www.apple.com/applescript/uiscripting/>

I hope this will be of interest to some of you.

Brennan


[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email [EMAIL 
PROTECTED]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for learning and helping 
with programming Lingo.  Thanks!]

Reply via email to