Part of the Samples Website. 8/16/97.

samples.basicStuff.buildFolderOutline

«Produces an outline that mirrors the structure of a folder
local (path)
if file.getFolderDialog ("Folder to traverse?", @path) «user clicked on OK
bundle «open or create the list in the user's people table
local (list = @people.[user.initials].folderOutline)
if not defined (list^) «the outline doesn't exist, create it
new (outlineType, list)
edit (list) «open it in a window
op.wipe () «initialize it, one empty headline
op.setLineText (path) «show the full path to the folder in the main head
on traverse (path)
local (f)
fileloop (f in path)
op.insert (file.fileFromPath (f), dir)
dir = down
if file.isFolder (f) «dive into the folder
dir = right
traverse (f) «recurse
if dir != right «at least one item added from the folder
op.go (left, 1)
dir = down
rollBeachBall ()
local (dir = right) «first headline inserted to the right of summit
traverse (path)
op.firstSummit ()
op.collapse ()
op.expand (1)


This page was last built on Sat, Aug 16, 1997 at 6:33:00 PM. You can download the current set of sample scripts from our FTP site. Dave