Quick and Dirty GSAK Macros


This blog entry is long overdue and it’s going to be a geeky one! 🙂 A big thank you to the comments and emails I received following my GSAK 8 beginners guide blog post. I’m delighted that so many Geocachers have got to grips with GSAK after reading it.

Macros provide a way of automating GSAK, however require that you write code to create them – something that terrifies a lot of people! The Master Macro Index provides some great macros written by the community. Personally, I don’t spend much time writing big hefty macros, however there are a couple of quick and dirty ones which I have created that I often use with filters when quickly loading my GPS up for a caching trip (Particularly useful if you’re caching whilst on holiday)

When I’m heading off caching I will load the GPS up with a good thousand or so caches. Maybe I’ll be going for a walk around a series, maybe I’ll be hoping to quickly stop off and grab a cache as a drive-by as I see it appear. When Geocaching the best thing to do is check the cache description, check the logs to make sure everything is ok, etc. but let’s be honest… We don’t always do that. We end up hunting for 10 minutes for a cache only to realise it’s disabled or has a string of 5 DNFs on it or we go looking for a place to park for what looks like a “cache and dash” only to find it’s on a footpath that passes along a motorway.

The following macros modify the title field of the cache so that you can instantly see on your GPS if a cache is missing, disabled, a cache and dash or has a lot of favourite points. Just those useful little things when you’ve not done a lot of planning and want to see cache information instantly.

Creating a macro

Creating a Macro is simple, fire up GSAK, click the ‘Macro’ menu and then ‘Edit/Create’

Create a macro using the GSAK Macro menu

Create a macro using the GSAK Macro menu

Type in your macro code (Or in this case copy and paste the code at the bottom of this blog entry) and then click File –> Install

Installing a new macro

Installing a new macro

GSAK will then prompt you. Select ‘Install the macro’

GSAK prompts you to install the macro

GSAK prompts you to install the macro

Your new macro will appear in your macros list (Macros –> Run/Manage…)

The macro displays in the list

The macro displays in the list

What the macros do…

Most of the macros are very simple. They append 3 letters to the beginning of a cache name depending on the macro that is run. BEFORE you run one of these macros you MUST have a filter set otherwise it will change all of your caches in the database! I’ve outlined which filter to set for each macro. If we were going to run the ‘Label as disabled’ macro we would first run a filter that only displays the disabled caches in our database.

The cache names have DIS_ at the beginning. UserData2 is also populated with DIS

The cache names have DIS_ at the beginning. UserData2 is also populated with DIS

The macros also populate the UserData2 field. Why? Look what happens if that cache is updated in the database:

The cache name is reset when a cache is updated, but UserData2 remains unchanged

The cache name is reset when a cache is updated, but UserData2 remains unchanged

We can run a filter to grab all those caches which are marked as DIS in the userdata2 filed, but not DIS in the cache title so that we can run the macro again and update those that have been wiped over by a refresh:

This filter returns those caches with DIS in the UserData2 field, but not in the cache title

This filter returns those caches with DIS in the UserData2 field, but not in the cache title

This filter will return just the cache that hasn’t been marked with DIS in the title, but has got DIS in the UserData2 field.

Only the "stray" disabled cache is returned by this filter

Only the “stray” disabled cache is returned by this filter

We could then run the ‘Label as disabled’ macro again and it would update this cache to match the other disabled ones. We do it this way to prevent having a cache labeled DIS_DIS_DIS_Cachename if some don’t get updated when others do.

Here’s how the caches on our GPS will look once we’ve tweaked them:

The titles now include more information about the cache

The titles now include more information about the cache

Does that make sense? I hope so! Here’s how to do it yourself…

Just one more thing before you run them…

These macros are quick and dirty. I usually create a new database first and populate it with caches in the area that I’m heading to before quickly running the macros and then loading the caches onto my GPS. It’s up to you if you want to run them on your main database (If you maintain one, that is). Any changes that they make can be easily removed when you update the caches in the database.

Label a cache as a ‘Cache and dash’

Set this filter

Set the 'Park and grab' attribute to 'Yes'

Set the ‘Park and grab’ attribute to ‘Yes’

Enter this macro code

#*******************************************
# MacVersion = 1.0
# MacDescription = Label as CnD
# MacAuthor = https://geocass.wordpress.com
#*******************************************
GOTO position=top
WHILE not ($_EOL)
$d_Name = "CnD_" + $d_Name
$d_User2= "CnD"
GOTO position=next
ENDWHILE

Run the macro to get:

Cache and dash results

Cache and dash results

Label a cache as a ‘Disabled’

Set this filter:

Set this filter to display only disabled caches

Set this filter to display only disabled caches

Enter this macro code:

#*******************************************
# MacVersion = 1.0
# MacDescription = Label as Disabled
# MacAuthor = https://geocass.wordpress.com
#*******************************************
GOTO position=top
WHILE not ($_EOL)
$d_Name = "DIS_" + $d_Name
$d_User2= "DIS"
GOTO position=next
ENDWHILE

Run the macro to get:

Notice that as we are appending our text to cache names we have CnD_DIS_ for some

Notice that as we are appending our text to cache names we have CnD_DIS_ for some

Label a cache as ‘missing’

Set this filter:

Set this filter to show those caches which are likely to be missing. At the same time you may also like to make sure you're filtering for 'Available' caches only so that you don't get disabled ones in your results as we will have used the disabled macro to mark those already.

Set this filter to show those caches which are likely to be missing. At the same time you may also like to make sure you’re filtering for ‘Available’ caches only so that you don’t get disabled ones in your results as we will have used the disabled macro to mark those already.

Enter this macro code:

#*******************************************
# MacVersion = 1.0
# MacDescription = Label as missing
# MacAuthor = https://geocass.wordpress.com
#*******************************************
GOTO position=top
WHILE not ($_EOL)
$d_Name = "MIS_" + $d_Name
$d_User2= "MIS"
GOTO position=next
ENDWHILE

Run the macro to get:

Caches with 3 or more DNFs in the last 3 logs are marked as missing

Caches with 3 or more DNFs in the last 3 logs are marked as missing

Label a cache as a ‘favourite’

Set this filter:

We've set the filter so that only caches with 10 or more favourite points are shown. You could change this number to anything you like however.

We’ve set the filter so that only caches with 10 or more favourite points are shown. You could change this number to anything you like however.

Enter this macro code:

#*******************************************
# MacVersion = 1.0
# MacDescription = Label with favourite points
# MacAuthor = https://geocass.wordpress.com
#*******************************************
GOTO position=top
WHILE not ($_EOL)
$d_Name = "f" + NumToStr($d_FavPoints) +"_" +$d_name
GOTO position=next
ENDWHILE

Run the macro to get:

The caches are marked as f## where ## shows the number of favourite points for that cache

The caches are marked as f## where ## shows the number of favourite points for that cache

I’m confused. What?

Just have a play. Create a test database with a bunch of caches in, run the macros against that and you’ll soon get a good feel for how these little macros work. Otherwise, you know where I am! Drop a comment below and I’ll get back to you as soon as I can! 🙂

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s