home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Misc / HYPERBOOK2.DMS / in.adf / Macros / sample / ChangeNoteNames < prev    next >
Encoding:
Text File  |  1990-09-02  |  805 b   |  32 lines

  1. /* ChangeNoteNames - This insanely useful macro goes through an entire
  2.    hyperbook page by page. On each page, if there is an object called Note1,
  3.    it gives it the same name as the page.
  4.  
  5.    (This was actually written for a reason: the first note on every page
  6.    of the ARexx commands hyperbook is, like the page, supposed to have as
  7.    its name the name of the command it describes. This macro caught the
  8.    ones I missed.)
  9. */
  10.  
  11. do i=1 to numpages()
  12.  
  13.    page = i || ':'
  14.  
  15.    call searchstart(page)
  16.  
  17.    found = 0
  18.  
  19.    do j=1 to numelements(page)
  20.  
  21.       if getname(objectnumber(page, j)) == 'Note1' then do
  22.  
  23.          call setname(objectumber(page, j), getname(page))
  24.          found = 1
  25.          end
  26.  
  27.       if found == 1 then break
  28.       end
  29.  
  30.    if found == 0 then say 'Page' i '- Note 1 not found'
  31.    end
  32.