home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-07-29 | 956 b | 27 lines | [TEXT/ttxt] |
- # NewTarget - replacement "Target" script supporting file backup and remember
-
- If ({#} == 1)
- # correct number of command line arguments
- Target "{1}" ∑∑ Dev:Null # invoke the standard open
- Set TargetStatus {Status}
- If ({TargetStatus} == 0)
- # the Target was successful - perform the Backup and Remember chores
- ReadOnlyStatus "{1}" ∑∑ Dev:Null # test if this is a read-only file
- If ({Status} == 0)
- Set LeafName "`ParseFileName -l "{1}"`" # get the file's leafname
- Duplicate -y "{1}" "{Backup}" ∑∑ "{Worksheet}" || Beep # create the backup file
-
- # Delete all the old "Remember" backup files
- For i in `Begin; Files -f "{Backup}{LeafName}".[0-9]+; End ≥ Dev:Null`
- Delete "{i}"
- End # For i
- End # If {Status}
- Else
- # an error occured
- Alert "{0}:∂nUnable to make file {1} the target."
- End # If {OpenStatus}
- Else
- Alert "{0}:∂n{Parameters} is not a valid target window."
- End # If {#}
-
- # end of NewTarget