on readHeadFile (f, adroutline) |
| local (firstline = true, level, lastlevel) |
| toys.newObject (outlineType, adroutline) |
| while not file.endOfFile (f) |
| s = file.readLine (f) - char (10) |
| if s beginsWith char (26) «end of file |
| if string.lower (s) beginswith ".head" |
| s = string.delete (s, 1, 6) «pop off the .HEAD |
| while string.isNumeric (s [1]) |
| level = level + string (s [1]) |
| s = string.delete (s, 1, 1) |
| s = string.delete (s, 1, 3) |
| op.go (left, lastlevel - level) |
| window.close (adroutline) |
| local (folder = "Macintosh HD:New Releases:ThinkTank Templates:", f) |
| local (adrtable = @scratchpad.tankTemplates) |
| toys.newObject (tabletype, adrtable) |
| readHeadFile (f, @adrtable^.[file.fileFromPath (f) - ".TXT"]) |