home *** CD-ROM | disk | FTP | other *** search
- Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
- Path: sparky!uunet!europa.eng.gtefsd.com!gatech!udel!darwin.sura.net!spool.mu.edu!sdd.hp.com!usc!howland.reston.ans.net!paladin.american.edu!auvm!HARVUNXW.BITNET!EMP
- Return-Path: <emp@xgml.com>
- Message-ID: <9301281644.AA02801@jupiter.hekla.xgml.com>
- Newsgroups: bit.listserv.toolb-l
- Date: Thu, 28 Jan 1993 11:44:43 -0500
- Sender: Asymetrix 'Toolbook' product discussions <TOOLB-L@UAFSYSB.BITNET>
- From: emp%xgml.com@HARVUNXW.BITNET
- Subject: Changing scripts on the fly (was "Please Help!", David...)
- In-Reply-To: "JENNIFER A. HEISE"'s message of Wed,
- 27 Jan 1993 12:30:02 -0500 <9
- 301271807.AA26411@talcott.harvard.edu>
- Lines: 56
-
- > From: "JENNIFER A. HEISE" <jahb@LEHIGH.EDU>
-
- > Does anybody have any scripts that could set a certain property of all the
- > fieldds in a book without first knowing how many fields there are and what
- > their names/ids are? Can this be done? Or must it be done by hand?
-
- Here's the sort of thing I do all the time. I started testing this,
- but got an Application Termination Error after the first call to
- execute.
-
- to handle protectAux theObj, theLayer
- execute "set activate of" && theObj && "of this" && theLayer
- end
-
- to handle protectFields
- step i from 1 to itemCount (backgrounds of this book)
- go first page of item i of backgrounds of this book
- step j from 1 to itemCount (objects of this background)
- conditions
- when object of item j of objects of this background is "field"
- send protectAux item j of objects of this background, "background"
- when object of item j of objects of this background is "recordField"
- send protectAux item j of objects of this background, "background"
- end conditions
- end step
- end step
- step i from 1 to pageCount of this book
- go page i of this book
- step j from 1 to itemCount (objects of this page)
- conditions
- when object of item j of objects of this page is "field"
- send protectAux item j of objects of this page, "page"
- end conditions
- end step
- end step
- end protectFields
-
- The good thing about this technique is that you can generalize it.
- Instead of calling protectAux, for example, pass in the name of some
- function and execute that line. Lisp programmers who've used mapcar
- will know what I'm talking about. For the rest of you, oh well ...
-
- I also have a nifty TB handler which toggles the activated of
- a field/recordField just by pressing shift-ctrl right-button.
- Put this in a system stack:
-
- to handle rightButtonUp loc, isShift, isCtrl
- if isShift and isCtrl and (object of target is "field" or \
- object of target is "recordField") then
- set the activated of target to not the activated of target
- else
- forward rightButtonUp
- end if
- end
-
- -- Eric Promislow--emp@xgml.com--Exoterica Corporation, Ottawa, Ontario
-