How To: Create a backup of an ArcView project
The following script creates a copy of the current .apr file and places it in the $HOME directory. When you save the project, this script will create a file with the same project name and a .bak extension instead of .apr. You can then manually change the .bak file extension to .apr and load it as an ArcView Project.
- In your current ArcView project, open a New Script window. A. Activate the Project window.
B. Click the Scripts icon.
C. Click New.
- Use the Open System Script button
to load the Project.Save script into the script window.
- Copy the following code at the end of the Project.Save script. Rename the script window to Project.Save:
theProject = av.GetProject
theProjName = theProject.GetFileName
theprojStrng = theProjName.AsString
theCount = theProjstrng.count
thefnlCount = (theCount - 4)
theNewName = theProjStrng.left(thefnlCount)
theNewBak = theNewName ++ ".Bak"
theNewBakFile = theNewBak.AsFileName
'-- Makes a Bak file of current APR
theFName = TextFile.Make( theNewBakFile, #FILE_PERM_WRITE )
theAPR = TextFile.Make( theProjName, #FILE_PERM_READ )
source = theAPR.Read( theAPR.GetSize )
theFName.Write( source, theAPR.GetSize )
- Click the Compile
When you save this project, it will automatically save a file with the .bak extension to the default working directory.