If all goes well, this will take you through the steps needed to automate GSAK’s handling of Pocket Queries. The first thing you need to do is set up your pocket queries on Geocaching.com.

Several times a week I update all unfound caches in Maine and New Hampshire. Depending on the day of the week I have between 2 and 5 PQ’s that are generated by GC.com. Once you have your PQ’s set up properly and your receiving the information your looking for your ready to tackle the GSAK settings.

First you need to create the directory that will handle your PQ Zip Files. I have a directory C:/temp/geomail that I use for all my geomail zip file work. Create it and name it what ever you want, just make sure you know where the directory is and what you have named it.

Now open GSAK and go to the File section and click on Load/GPX/LOC/ZIPFILE tab. Use the following screenshot to help you fill in the necessary information.

See Attactment 1: PQsLoadandDelete

Once you have the setting as listed with your particulars filled in be sure to save it as PQsLoadandDelete or whatever you want to name it. Be sure to click the Save Tab.

You next need to set up your GetMail settings in GSAK. Click on File/Get Data via Email.

I use a Google Mail account (IT’S FREE!) because Google mail handles files in a way that makes this work best. I tried Outlook and had problems. So I recommend the Google Gmail route.
In registering and opening your google mail account give it a unique name. I used my geocaching handle.gsak.notify. When you have that all set you have to configure your forwarding information. You can use either POP or IMAP Mail in Gmail (IMAP is a new format – I use this and it works very well)!

For POP Click on Configuration Instructions in your Gmail account. Select your email client from the list and follow their recommendations.

For IMAP do the same if that is the forward format you decide to use. As I said I use Outlook2007. Just make sure you set up according to the directions they put forth there for your email client.

Now back to GetMail in GSAK. Here is the screen shot of the GetMail settings:

See Attachment 2: movePQtoHome

As above be sure you save the GetMail setting by clicking on Save and naming it in my case movePQtoHome.

Now you need the Macros that make all the important things happen.

Here is the first Macro: You need to cut and paste (the stuff between the two +++++ lines) into the Macro Directory in GSAK naming it - GetMail_Delete_Archive.gsk

################################################## ###########
# Macro to automate "cleaning up" your database by setting #
# up to three different cache statuses (archived, #
# temporarily unavailable or found) for deletion. #
# #
# Note: this macro will delete the specified caches from #
# your currently selected database. Be sure that you're in #
# the database you want to clean up BEFORE running this #
# this macro! #
# #
# The first time it's run, this macro will ask you to #
# identify the status of the caches you want to delete. It #
# will store this information in a file called #
# "CleanUpData.dat" in the GSAK\Macros folder so that #
# you don't have to answer the questions again. If you #
# want to change this information later, delete the #
# CleanUpData.dat file and run the macro again. #
################################################## ###########

VerCheck Version=7.1.2.30 (please update GSAK to the latest version to run this macro - see http://gsak.net)

# No? Ask for the status of cahces you want to delete.
# Delete Unfound Archived?
$inputmsg="Do you want to delete all archived caches that that you haven't found? (Y/N)"
INPUT Msg="$inputmsg" Default="Y" Varname=$Archived

# Filter for the desired cache status to delete
IF $Archived="Y" and $TempUnavailable="Y" and $Found="Y"
MFilter IF=$d_archived or $d_TempDisabled or $d_Found
ENDIF

IF $Archived="Y" and $TempUnavailable="Y" and $Found<>"Y"
MFilter IF=(not ($d_Found) and $d_archived) or (not ($d_found) and $d_TempDisabled)
ENDIF

IF $Archived="Y" and $Found="Y" and $TempUnavailable<>"Y"
MFilter IF=$d_archived or $d_Found
ENDIF

IF $TempUnavailable="Y" and $Found="Y" and $Archived<>"Y"
MFilter IF=$d_TempDisabled or $d_Found
ENDIF

IF $Archived="Y" and $TempUnavailable<>"Y" and $Found<>"Y"
MFilter IF=(not ($d_Found) and $d_archived)
ENDIF

IF $TempUnavailable="Y" and $Found<>"Y" and $Archived<>"Y"
MFilter IF=(not ($d_found) and $d_TempDisabled)
ENDIF

IF $Found="Y" and $Archived<>"Y" and $TempUnavailable<>"Y"
MFilter IF=$d_Found
ENDIF

#Test to insure there are waypoints in the filter and delete if found
IF $_FilterCount > 0
MacroSet Dialog=Delete VarName=$Delete
DELETE Settings=<macro>
ELSE
PAUSE Msg="No waypoints in filter, action cancelled"
ENDIF

Now your ready to run the whole Macro. You start by testing it in stages.

First run your Get Mail via Email from GSAK. If it completes without stopping or generating an error message then your setting are all OK.

Second run your Load GPZ/LOC/ZIPFILE called PQsLoadandDelete. Click OK.

No go to your Gmail Account and un-archive the PQ’s you just ran.

Make a Macro Button in GASK and add it to your Menu Bar naming it “Get Mail/Pocket Queries” and point it to the GetMail_Delete_Archives.qsk macro in the GSAK Macro Directory. If you have done it all correctly you should be able to click the Macro Button you just created and watch the whole macro run and exit GSAK.

You handle all your Pocket Queries with just the click of one button.

If you get error messages or if the macro aborts you need to make sure it actually has a Pocket Query in the Google Mail Account.

I will help you if you need help.

Gob-ler

01-27-2008, 11:09 PM

I know the screenshots are small, if anyone needs them drop me a note and I will email them to you.

Better yet, if there is a better way to handle the attachment files please let me know as I may not have done it correctly.

Gob-ler

01-01-2010, 02:39 PM

There have been some changes since I wrote this. I have tried to update things. Please see the latest post on the matter.