home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / bit / listserv / toolbl / 42 < prev    next >
Encoding:
Text File  |  1993-01-28  |  2.8 KB  |  71 lines

  1. Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
  2. 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
  3. Return-Path: <emp@xgml.com>
  4. Message-ID: <9301281644.AA02801@jupiter.hekla.xgml.com>
  5. Newsgroups: bit.listserv.toolb-l
  6. Date:         Thu, 28 Jan 1993 11:44:43 -0500
  7. Sender:       Asymetrix 'Toolbook' product discussions <TOOLB-L@UAFSYSB.BITNET>
  8. From:         emp%xgml.com@HARVUNXW.BITNET
  9. Subject:      Changing scripts on the fly (was "Please Help!", David...)
  10. In-Reply-To:  "JENNIFER A. HEISE"'s message of Wed,
  11.               27 Jan 1993 12:30:02 -0500 <9
  12.               301271807.AA26411@talcott.harvard.edu>
  13. Lines: 56
  14.  
  15. > From: "JENNIFER A. HEISE" <jahb@LEHIGH.EDU>
  16.  
  17. > Does anybody have any scripts that could set a certain property of all the
  18. > fieldds in a book without first knowing how many fields there are and what
  19. > their names/ids are? Can this be done? Or must it be done by hand?
  20.  
  21. Here's the sort of thing I do all the time.  I started testing this,
  22. but got an Application Termination Error after the first call to
  23. execute.
  24.  
  25. to handle protectAux theObj, theLayer
  26.   execute "set activate of" && theObj && "of this" && theLayer
  27. end
  28.  
  29. to handle protectFields
  30.   step i from 1 to itemCount (backgrounds of this book)
  31.     go first page of item i of backgrounds of this book
  32.     step j from 1 to itemCount (objects of this background)
  33.       conditions
  34.       when object of item j of objects of this background is "field"
  35.         send protectAux item j of objects of this background, "background"
  36.       when object of item j of objects of this background is "recordField"
  37.         send protectAux item j of objects of this background, "background"
  38.       end conditions
  39.     end step
  40.   end step
  41.   step i from 1 to pageCount of this book
  42.     go page i of this book
  43.     step j from 1 to itemCount (objects of this page)
  44.       conditions
  45.       when object of item j of objects of this page is "field"
  46.         send protectAux item j of objects of this page, "page"
  47.       end conditions
  48.     end step
  49.   end step
  50. end protectFields
  51.  
  52.   The good thing about this technique is that you can generalize it.
  53. Instead of calling protectAux, for example, pass in the name of some
  54. function and execute that line.  Lisp programmers who've used mapcar
  55. will know what I'm talking about.  For the rest of you, oh well ...
  56.  
  57.   I also have a nifty TB handler which toggles the activated of
  58. a field/recordField just by pressing shift-ctrl right-button.
  59. Put this in a system stack:
  60.  
  61. to handle rightButtonUp loc, isShift, isCtrl
  62.   if isShift and isCtrl and (object of target is "field" or \
  63.    object of target is "recordField") then
  64.     set the activated of target to not the activated of target
  65.   else
  66.     forward rightButtonUp
  67.   end if
  68. end
  69.  
  70. -- Eric Promislow--emp@xgml.com--Exoterica Corporation, Ottawa, Ontario
  71.