D6x saveBot

Date: Thu Mar 11 06:33:51 MST 1999
From: Geoff Hoffman <ghoffman@sirentech.com>
Subject: D6x saveBot
I have this project with about 100 .dir files in the 'content' folder.

A couple of times I changed (organized, reordered) the shared castlib. Then I had to go thru the files one by one, open them, click "Adjust" when D6 asked 'certain members in the shared cast have changed positions blah blah'.

After doing this once I realized how annoying it is, so I wrote a little saveBot object. It's very rudimentary right now, but here it is.

The way it works, you drop the saveBot.dir into your project folder (it doesn't go into nested folders yet) and open it. Then in the message window, type:

set gSaver = new(script "saveBot", ".dir")
-- {director returns a list of .dir files in the same folder as saveBot.dir}
To save the movies contained in the list, type, into the message window:
saveMoviesInFolder(gSaver)

Notes

  1. if you have a prepareMovie handler, or a startMovie handler, it executes even though the playback head is on 'stop'. I'm assuming this is because I am using the syntax 'go to movie x' -- here, i was wondering if there is an 'open movie x' command that just opens the director file, but doesn't execute startMovie or prepareMovie handlers...
  2. You still have to sit there and click 'Adjust' but Director does all the rest, and reports progress in the message window.
  3. the other handy thing about using this script... let's say you have some pictures that are in the same spot across multiple .dir files. Using file-open, the stage turns black in between closing A and opening B -- so you can't tell if the graphics will 'jump' a pixel or two in between movies. Using this script, there's no flash in between movies, and you can see if there's pixel shift.
  4. it's written for D6 syntax, but it'll take someone 1 minute to convert it to dot-syntax.
  5. I assume that even on the mac you're using .dir in the file name... is there a way to get the creator code of files listed so it could work on Director movies regardless of their name...?
  6. I was planning on making this code work from a button in an author-time MIAW -- it would need to tell the stage to get it's moviePath so you don't need the util.dir in the same folder as the content all the time... but that'll come in v.2 ;)
-- ======================================================

-- SaveBot v.1.0 D6 code by Geoffrey Hoffman, March 1999
-- Geoffrey D. Hoffman
-- Chief Content Engineer / Multimedia Creative Director
-- Siren Technologies / A Wholly Owned Subsidiary of Frankel.
-- 111 East Wacker Drive Suite 23110
-- Chicago IL 60601
-- EMAIL: ghoffman@sirentech.com
--
-- If you use this a lot and want to pay me for it, knock yourself out.
--
-- methods
--         'new me, thisExtension'
--         'saveFilesInFolder me'
--


-- parent script in saveBot.dir
-- name of parent script is "saveBot"

property pListOfFiles, pFileExtension

on new me, thisExtension
  set the pListOfFiles of me = []
  set aListOfFiles = []
  set the pFileExtension of me = thisExtension

  -- first get the raw file list in the folder
  repeat with index = 1 to the maxInteger
    set myFile = getNthFileNameInFolder(the moviePath, index)
    if myFile = "" then
      exit repeat
    else
      add aListOfFiles, myFile
    end if
  end repeat

  -- clean up the list so it only contains the specified extension files
  repeat with x in aListOfFiles
    if x contains the pFileExtension of me then
      if not (x contains "Util") then
        add the pListOfFiles of me, x
      end if
    end if
  end repeat
  sort the pListOfFiles of me
  put the pListOfFiles of me
  put "Use 'SaveMoviesInFolder me' to save these" && count(the
pListOfFiles of me) && the pFileExtension of me && "files."
  return me
end new

on saveMoviesInFolder me
  put "Saving" && count(the pListOfFiles of me) && the pFileExtension of
me && "files."

  repeat with x in the pListOfFiles of me
    go to movie x
    saveMovie x
    put "Saved movie " & x
  end repeat

  alert "All done saving" && the pFileExtension of me && "files."
end saveMoviesInFoler