home *** CD-ROM | disk | FTP | other *** search
Text File | 1999-03-04 | 972 b | 47 lines | [TEXT/ToyS] |
- global gasFolders
-
-
- on open fsObjs
- set gasFolders to {}
- repeat with fsObj in fsObjs
- DoItem(fsObj)
- end repeat
-
- repeat while gasFolders is not {}
- set foldObj to item 1 of gasFolders
- set gasFolders to edit list gasFolders with edits {-1}
- DoFolder(foldObj)
- end repeat
- end open
-
-
- on DoFolder(foldObj)
- -- Do files
- set foldPath to foldObj as string
- set fItems to the entries in foldObj whose kinds are a file
- repeat with fItem in fItems
- DoOne((foldPath & fItem) as alias)
- end repeat
- end DoFolder
-
-
- on DoItem(fsObj)
- set bi to basic info for fsObj
- if (catalog kind of bi) is a folder then
- set gasFolders to gasFolders & {fsObj}
- else
- DoFile(fsObj, bi)
- end if
- end DoItem
-
-
- on DoFile(fsObj, info)
- if (system type of info) is "ttro" then
- set system type of info to "TEXT"
- set the catalog info of fsObj to info
- else if (system type of info) is "TEXT" then
- set system type of info to "ttro"
- set the catalog info of fsObj to info
- end if
- end DoFile
-