Date: Thu Mar 11 06:33:51 MST 1999 From: Geoff Hoffman <ghoffman@sirentech.com> Subject: D6x saveBotI 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)
-- ======================================================
-- 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