# DirMenu - Set up the MPW directory menu they way I want it # All directories of the form ‰:Development:‰ are added # Directories of the form ‰:Development:Others:‰ are appended hierarchically # Hierarchical menus need the DemoteMenu and SetSubMenu tools available # on the Developer's CD series and the commands are not executed, but written # to a file {MPW}MPW.HierStuff. Set Echo 0 Set Exit 0 DeleteMenu Directory „ Dev:Null AddMenu Directory 'Show Directory'  '(Echo "The default directory is n"; Directory) | Alert -s' AddMenu directory 'Set DirectoryŠ'  'set __OldExit__ "{exit}";  unset exit;  Set __Directory__ "`GetFileName -d; set __tmpStatus__ "{status}"`";  if "{__tmpStatus__}" == 0;  SetDirectory {__Directory__} > "{ShellDirectory}"MPW.Errors „ Dev:StdOut;  if "{status}" != 0;  Alert < "{ShellDirectory}"MPW.Errors;  end;  end;  set exit "{__OldExit__}";  unset __Directory__ __OldExit__ __tmpStatus__' AddMenu Directory '(-' '' Set Exit 1 Perl -Sx "{0}" ‰:>"{MPW}TmpMDEFS" && Execute "{MPW}TmpMDEFS" && Delete -y "{MPW}TmpMDEFS" Exit 0 # # Now for the Perl part #!/usr/local/bin/perl $MPW = $ENV{'MPW'}; $hi = $MPW . "MPW.HierStuff"; open(HIER, ">>$hi") || die "Could not open $hi"; foreach $vol (@ARGV) { $dev = $vol . "Development"; next unless -d $dev; opendir(DEV, $dev) || die "Couldn't open $dev"; while ($dir = readdir(DEV)) { next unless (-d "$dev:$dir"); print < \"{ShellDirectory}\"MPW.Errors „ Dev:StdOut  || Alert < \"{ShellDirectory}\"MPW.Errors\' END next unless $dir eq "Others"; opendir(OTH, "$dev:$dir") || die "Couldn't open $dev:$dir"; while ($od = readdir(OTH)) { print < \"{ShellDirectory}\"MPW.Errors „ Dev:StdOut  || Alert < \"{ShellDirectory}\"MPW.Errors\' END } print HIER <