#*********************************************************************************************** # MacVersion = 1.3 # MacDescription = Update Belgian archived caches to status 'archived' in GSAK # MacAuthor = weedboer # MacFileName = BelgiumArchivedCaches.gsk # MacUrl = http://www.vanderschot.be #*********************************************************************************************** # PREPARATIONS: STEP 1: Database and location # ---------------------------------------------------- # Create a folder on your hard drive. In this folder you'll save the zip file containing the archived geocaches (i.e. "d:\cache\archived\") # Initialise the variable $archivedsourcefolder with the complete path to this folder # Get the name of the database containing all the belgian geocaches and which need to be cleaned (i.e. "Belgium") # Initialise the variable $belgiumdatabasename with the database name # # PREPARATIONS: STEP 2: Create "Move/Copy waypoint" setting # ------------------------------------------------------------ # Click on the top menu DATABASE > MOVE/COPY WAYPOINTS... # Choose as "Destination database" the belgian database (in this example: "Belgium") # Choose the "Copy" action # At "If waypoint already exists" choose "only flag" # At "If waypoint does NOT exist" choose "ignore" # Activate the option "Display destination database when finished" # Click "Save" and give the exact name "copy_archived_waypoints" (without quotes!) and click "OK" # Click "Cancel" # # PREPARATIONS: STEP 3: Create "Global Replace" setting # --------------------------------------------------------- # Click on the top menu DATABASE > GLOBAL REPLACE # Use following settings: # Replace = Available Status # With = Archived # Click "Save" and give the exact name "Archived" (without quotes!) and click "OK" # Click "Cancel" #*********************************************************************************************** # INITIALISE VARIABLES: USER ACTION REQUIRED # -------------------------------------------- $belgiumdatabasename = "Belgium" # Change if belgian database has a different name $archivedsourcefolder = "d:\cache\archived\" # Change if zip file with belgian archived geocaches is located elsewhere #*********************************************************************************************** # ===>> DON'T MAKE CHANGES BELOW THIS LINE <<<=== # ----------------------------------------------- # PRE-PROCESSING $archivedsourcefile = "Be_Archived.ZIP" $archivedsource = $archivedsourcefolder + $archivedsourcefile DATABASE Name=$belgiumdatabasename Action=select USERFLAG type=clear range=all IF DataBaseExists("Temp_Archived_DB") DATABASE Name="Temp_Archived_DB" Action=DELETE ENDIF DATABASE Name="Temp_Archived_DB" Action=create DATABASE Name="Temp_Archived_DB" Action=select # PROCESSING IF FileExists($archivedsource) LOAD File=$archivedsource database="Temp_Archived_DB" ShowStats=No MOVECOPY Settings="copy_archived_waypoints" DATABASE Name=$belgiumdatabasename Action=select MFILTER Expression=$d_UserFlag IF $_FilterCount > 0 Replace settings="Archived" ELSE PAUSE Msg="No waypoints in filter, action cancelled" ENDIF ELSE PAUSE Msg="File $archivedsource not found!" ENDIF # POST-PROCESSING DATABASE Name=$belgiumdatabasename Action=select CANCELFILTER USERFLAG type=clear range=all GOTO Position=Top DATABASE Name="Temp_Archived_DB" Action=DELETE INPUT Msg="May the zipped archive file be delete? Y/N?" Default="Y" VarName=$Result2 IF $Result2 = "Y" FILEERASE File=$archivedsource OnError=Continue ENDIF #*********************************************************************************************** # RELEASE NOTES v1.0 # Based on the BE_archived.zip file, which contains all belgian archived caches # this macro will set all caches in the chosen database to status "archived". # Download the source file here: http://statistieken.geocache.be/php/nl/GPXallarchivedcaches.php #*********************************************************************************************** # RELEASE NOTES v1.1 # Last action added: cancel user flags and filter #*********************************************************************************************** # RELEASE NOTES v1.2 # Full translation to English + some reordering of the process #*********************************************************************************************** # RELEASE NOTES v1.3 # Add question if the ZIP file may be deleted after the process #***********************************************************************************************