supermario/bin/MPW-3.2.3/Scripts/DirectoryMenu
2019-06-29 22:17:03 +08:00

44 lines
1.3 KiB
Plaintext

# DirectoryMenu - create the Directory menu
#
# Usage:
# DirectoryMenu directory…
#
# DirectoryMenu creates the menu shown below. The directory… parameter
# specifies the initial list of directories that appear in the menu.
#
# Directory
#
# Show Directory
# Set Directory…
# ----------------
# <directory…>
#
#
# Copyright Apple Computer, Inc. 1987 - 1990
# All rights reserved.
Set Exit 0
DeleteMenu Directory ≥ Dev:Null
AddMenu Directory 'Show Directory' ∂
'(Echo "The default directory is ∂n"; Directory) | Alert -s'
AddMenu Directory 'Set Directory…' ∂
'SetDirectory `GetFileName -d || Directory` > "{ShellDirectory}"MPW.Errors ≥ Dev:StdOut ∂
|| Alert < "{ShellDirectory}"MPW.Errors'
AddMenu Directory '(-' ''
For directory in {"Parameters"}
Set directory "`Files -i -f -q "{directory}" ≥ Dev:Null || Echo "{directory}"`"
if !`Evaluate "{directory}" =~ /?«0,64»/` # longer that 64 bytes?
Unset ®1 ; Unset ®2
(Evaluate "{directory}" =~ /([¬':']*)®1≈':'([¬':']+)®2':'/ ) ∑ dev:null
Set menuname "{®1}"':…:'"{®2}"
else
Set menuname "{directory}"
end
AddMenu Directory "{menuname}" ∂
'Directory "'"{directory}"'" > "{ShellDirectory}"MPW.Errors ≥ Dev:StdOut ∂
|| Alert < "{ShellDirectory}"MPW.Errors'
End
Exit 0