-- Written by Denny Dedmore in May 2002 -- Place this code in a button, and click the button at Reader Level. -- This will remove all openScript code from the book with the -- exception of openScript code used by ToolBook Question Objects -- This is to be used carefully, as it is really a brute force method -- of clearning openScript from a book. to handle buttonClick sc of self = sysCursor sysCursor = 4 targetBook = parent of MainWindow -- Process Book Script curObject = targetBook script of targetBook = null -- Process SharedScripts curSharedScripts = resourceList("sharedscript",targetBook) if curSharedScripts is not NULL ct = itemCount(curSharedScripts) step k from 1 to ct curObject = item k of curSharedScripts -- if shared script belongs to one of our widgets, -- we 'do not' want to muck with these. if chars 1 to 5 of name of curObject = "ASYM_" OR \ chars 1 to 4 of name of curObject = "WID_" -- this is our widget, skip it continue end script of curObject = null end end -- Process Viewers curViewers = windows of targetBook ct = itemCount(curViewers) step k from 1 to ct curObject = item k of curViewers script of curObject = null end -- Process Page Objects (& Page Script too) pc = pageCount of targetBook step k from 1 to pc curPage = page k of targetBook curObjects = getObjectList(curPage,"",true) if checkScript(curPage) is not NULL push curPage onto curObjects end if curObjects is not NULL ct = itemCount(curObjects) step j from 1 to ct curObject = item j of curObjects if curObject <> self script of curObject = null end end end end --Process Background Objects (& Background Script too) curBackgrounds = backgrounds of targetBook bgc = backgroundcount of targetBook step k from 1 to bgc curBackground = item k of curBackgrounds curObjects = getObjectList(curBackground,"",true) if checkScript(curBackground) is not NULL push curBackground onto curObjects end if curObjects is not NULL ct = itemCount(curObjects) step j from 1 to ct curObject = item j of curObjects script of curObject = null end end end -- All finished get asym_messagebox("Clearning of your scripts is finished!", \ "Done","information","ok","","") sysCursor = sc of self end