|
|
|
Fix Bad Scripts
Added on 11/29/1999
|
If you"ve ever come up against that director bug where all your scripts get confused about what type of script they are (ie. you get "handler not found" errors all over the place, and you can"t create new instances from your parent scripts) the usual solution is to change the scriptType of the offending scripts to something arbitrary, save and compact the movie, then change the scriptTypes back to what it should be and save the movie all over again.
From Andy Wilson"s Page of tips and Tricks
http://195.92.248.101:802/director
on fixScripts
set scrpts = []
set cntLibs = the number of castLibs
repeat with x = 1 to cntLibs
setAt (scrpts, x, [])
set libScrpts = getAt (scrpts, x)
set cntMems = the number of ¬
members of castLib x
if not cntMems then next repeat
repeat with y = 1 to cntMems
if the type of member y of ¬
castLib x <> #empty then
if the type of member y of ¬
castLib x <> #script then
set scTxt = the scriptText of ¬
member y of castLib x
setAt (libScrpts, y, scTxt)
set the scriptText of member y ¬
of castLib x = EMPTY
else
set styp = the scriptType of ¬
member y of castLib x
if offset("on fixScripts", the ¬
scriptText of member y of ¬
castLib x) then
setAt (libScrpts, y, #none)
else
setAt (libScrpts, y, styp)
if styp = #movie then
set the scriptType of member y ¬
of castLib x = #score
else
set the scriptType of member y ¬
of castLib x = #movie
end if
end if
end if
else
setAt (libScrpts, y, #none)
end if
end repeat
end repeat
saveMovie
set cnt = count (scrpts)
if not cnt then exit
repeat with x = 1 to cnt
set minLst = getAt (scrpts, x)
set cnt2 = count (minLst)
if not cnt2 then next repeat
repeat with y = 1 to cnt2
set val = getAt (minLst, y)
if val <> #none then
if symbolP(val) then
set the scriptType of member y ¬
of castLib x = val
else
if stringP(val) then
set the scriptText of member y
of castLib x = val
end if
end if
end if
end repeat
end repeat
saveMovie
end
|
|