Jump to content

Gsak Macros


Deckyon
Followers 17

Recommended Posts

I have set up a batch file that loads GSAK to run a specific macro. After downloading my personal querys as zip files, I kick off this macro. In short, here is what it does:

1. Imports each of the 4 queries into my database

2. Selects my Home point

3. Exports gpx files based on different saved queries

1. 0-25 miles

2. 25-50 miles

3. 50-75 miles

4. 75-100 miles

...

x. 475-500 miles

xx. My Found caches

4. From there I copy the GPX files to my SD card and plug it into my PDA.

5. On my PDA, I run either GPX Sonar or GPX view and select the file I want to use.

 

I do this because on PPc, the files load into memory, and by having multiple GPX files, I can keep the PPC memory clear for the GPS apps and still have enough caches to search through... I have over 4000 caches in the files, more than enough to keep me plenty busy.

 

While there is a bit of prep work in setting up the saved queries, it is worth it. What used to take me 30 minutes or more to do by hand now takes less than 5 minutes in the background while I work on something else.

 

If someone is interested, I can post the macro file for others to use.

Link to comment

Actually I would be interested to see the macro. One thing I really need to do is setup a batch file that would automate the process of downloading the .zip files from my email program (thunderbird) and then launch GSAK to automaticly update my SD card for my GPS and my Palm and Cachemate.

 

In order to really make this work I would need two SD card readers, and four SD cards (two in PC and one in each unit) then swap them each weekend.

 

Anouther thing that would be worth posting is arc/poly lines. I know I can generate them pretty easy with TopoUSA, but it still takes time to follow roads or encompass a park (I use it include or exclude cache within Rocky Mountain National Park)

Link to comment
Actually I would be interested to see the macro. One thing I really need to do is setup a batch file that would automate the process of downloading the .zip files from my email program (thunderbird) and then launch GSAK to automaticly update my SD card for my GPS and my Palm and Cachemate.

 

In order to really make this work I would need two SD card readers, and four SD cards (two in PC and one in each unit) then swap them each weekend.

 

Anouther thing that would be worth posting is arc/poly lines. I know I can generate them pretty easy with TopoUSA, but it still takes time to follow roads or encompass a park (I use it include or exclude cache within Rocky Mountain National Park)

because I work away from home for several days at a time I found that my email box was 'filling up' and I was getting 'Mailbox over the watermark' warnings from my service provider - result some emails were being bounced.

 

To overcome this problem I downloaded a free email client called Calypso. I set this up to check my email several times a day and download any Pq attachments into a specific folder and delete them from the email.

 

I then get Win2K to schedule the following simple GSAK Macro to load the PQ's.

 

DATABASE Name="UK All" Action=select

LOAD Settings="Open All"

FILTER name="Dummy"

EXPORT Type=gpx File="D:\GSAK GPX Files\Dummy.gpx"

EXIT

 

Note: The Dummy.gpx file is created to ensure that there is always a file in the folder to load. If the folder is empty then the macro pauses warning that there are no files in the folder and waits for the OK button to be pressed before continuing - no good when I'm not there.

 

Something similar to the above should enable you to get the results you desire.

Link to comment

Here is the full step by step of my macro.

 

First, create an "Open GPX/LOC File" profile. This will allow you to call it from within your macro.

 

Since I am using an SD card in my Axim for the geocache files, I make sure it is in my card reader and assigned a driveletter - preferably the same drive letter all the time.

 

Next, create a .cmd file (win NT, 2000 and XP) or .bat file (win 95, 98, ME) containing the following lines:

CD "<SD Drive>:\My Documents\geocaches\"

MKDIR geocaches

Echo Hit ENTER to run GSAK in Automated Mode

PAUSE

"C:\Program Files\GSAK\GSAK.exe" /run "C:\Program Files\GSAK\Macros\AximExport.txt"

EXIT

* Change "<SD Drive>" to match the drive letter you have, and the path to where you want to store the exports.

 

Now, in GSAK, set up the following Stored filters:

"000-025 Miles"

"025-050 Miles"

"050-075 Miles"

"075-100 Miles"

"100-125 Miles"

"125-150 Miles"

"150-175 Miles"

"175-200 Miles"

"200-225 Miles"

"225-250 Miles"

"250-275 Miles"

"275-300 Miles"

"300-325 Miles"

"325-350 Miles"

"350-375 Miles"

"375-400 Miles"

"400-425 Miles"

"425-450 Miles"

"450-475 Miles"

"475-500 Miles"

"Found"

* I use these to help with keeping memory free on the Axim when the GPXSonar app is running. Speeds up the searches.

 

Enter your home coordinates as the HOME location in the Options. Make sure it is set for HOME.

 

Now, create a txt file that matches what is in the cmd or bat file above and paste the following text:

LOAD Settings="Default" database="Default"

DATABASE Name="Default" Action=select

CENTRE LOCATION="Home"

FILTER Name="000-025 Miles"

EXPORT Type=GPX File="<SD Drive>:\My Documents\geocaches\000-025_Miles.gpx"

ENDFILTER

FILTER Name="025-050 Miles"

EXPORT Type=GPX File="<SD Drive>:\My Documents\geocaches\025-050_Miles.gpx"

ENDFILTER

FILTER Name="050-075 Miles"

EXPORT Type=GPX File="<SD Drive>:\My Documents\geocaches\050-075_Miles.gpx"

ENDFILTER

FILTER Name="075-100 Miles"

EXPORT Type=GPX File="<SD Drive>:\My Documents\geocaches\075-100_Miles.gpx"

ENDFILTER

FILTER Name="100-125 Miles"

EXPORT Type=GPX File="<SD Drive>:\My Documents\geocaches\100-125_Miles.gpx"

ENDFILTER

FILTER Name="125-150 Miles"

EXPORT Type=GPX File="<SD Drive>:\My Documents\geocaches\125-150_Miles.gpx"

ENDFILTER

FILTER Name="150-175 Miles"

EXPORT Type=GPX File="<SD Drive>:\My Documents\geocaches\150-175_Miles.gpx"

ENDFILTER

FILTER Name="175-200 Miles"

EXPORT Type=GPX File="<SD Drive>:\My Documents\geocaches\175-200_Miles.gpx"

ENDFILTER

FILTER Name="200-225 Miles"

EXPORT Type=GPX File="<SD Drive>:\My Documents\geocaches\200-225_Miles.gpx"

ENDFILTER

FILTER Name="225-250 Miles"

EXPORT Type=GPX File="<SD Drive>:\My Documents\geocaches\225-250_Miles.gpx"

ENDFILTER

FILTER Name="250-275 Miles"

EXPORT Type=GPX File="<SD Drive>:\My Documents\geocaches\250-275_Miles.gpx"

ENDFILTER

FILTER Name="275-300 Miles"

EXPORT Type=GPX File="<SD Drive>:\My Documents\geocaches\275-300_Miles.gpx"

ENDFILTER

FILTER Name="300-325 Miles"

EXPORT Type=GPX File="<SD Drive>:\My Documents\geocaches\300-325_Miles.gpx"

ENDFILTER

FILTER Name="325-350 Miles"

EXPORT Type=GPX File="<SD Drive>:\My Documents\geocaches\325-350_Miles.gpx"

ENDFILTER

FILTER Name="350-375 Miles"

EXPORT Type=GPX File="<SD Drive>:\My Documents\geocaches\350-375_Miles.gpx"

ENDFILTER

FILTER Name="375-400 Miles"

EXPORT Type=GPX File="<SD Drive>:\My Documents\geocaches\375-400_Miles.gpx"

ENDFILTER

FILTER Name="400-425 Miles"

EXPORT Type=GPX File="<SD Drive>:\My Documents\geocaches\400-425_Miles.gpx"

ENDFILTER

FILTER Name="425-450 Miles"

EXPORT Type=GPX File="<SD Drive>:\My Documents\geocaches\425-450_Miles.gpx"

ENDFILTER

FILTER Name="450-475 Miles"

EXPORT Type=GPX File="<SD Drive>:\My Documents\geocaches\450-475_Miles.gpx"

FILTER Name="475-500 Miles"

EXPORT Type=GPX File="<SD Drive>:\My Documents\geocaches\475-500_Miles.gpx"

ENDFILTER

FILTER Name="Found"

EXPORT Type=GPX File="<SD Drive>:\My Documents\geocaches\Found.gpx"

ENDFILTER

EXIT

 

I created a link to the cmd file (located in the GSAK directory) and run it after I have downloaded the zip files into the directory specified in the "Open GPX/LOC File" profile and run the cmd file.

Link to comment

Main Macro

# GSAK Update

LOAD Setting="GSAK Update"

# Data for Belgium

FILTER Name="99 BE Main"
EXPORT Type=OZI  File="D:\Geocaching\ExpOZI\GC Belgique.wpt"

FILTER Name="99 BE Antwerpen"
EXPORT Type=GPX  File="D:\Geocaching\ExpGPX\GC BE Antwerpen.gpx"
FILTER Name="99 BE Brabant wallon"
EXPORT Type=GPX  File="D:\Geocaching\ExpGPX\GC BE Brabant wallon.gpx"
FILTER Name="99 BE Hainaut"
EXPORT Type=GPX  File="D:\Geocaching\ExpGPX\GC BE Hainaut.gpx"
FILTER Name="99 BE Limburg"
EXPORT Type=GPX  File="D:\Geocaching\ExpGPX\GC BE Limburg.gpx"
FILTER Name="99 BE Liège"
EXPORT Type=GPX  File="D:\Geocaching\ExpGPX\GC BE Liège.gpx"
FILTER Name="99 BE Luxembourg"
EXPORT Type=GPX  File="D:\Geocaching\ExpGPX\GC BE Luxembourg.gpx"
FILTER Name="99 BE Namur"
EXPORT Type=GPX  File="D:\Geocaching\ExpGPX\GC BE Namur.gpx"
FILTER Name="99 BE Oost-Vlaanderen"
EXPORT Type=GPX  File="D:\Geocaching\ExpGPX\GC BE Oost-Vlaanderen.gpx"
FILTER Name="99 BE Vlaams-Brabant"
EXPORT Type=GPX  File="D:\Geocaching\ExpGPX\GC BE Vlaams-Brabant.gpx"
FILTER Name="99 BE West-Vlaanderen"
EXPORT Type=GPX  File="D:\Geocaching\ExpGPX\GC BE West-Vlaanderen.gpx"
FILTER Name="99 BE _non affectées"
EXPORT Type=GPX  File="D:\Geocaching\ExpGPX\GC BE Autres.gpx"

# Data for Luxemburg

FILTER Name="99 LU Main"
EXPORT Type=GPX  File="D:\Geocaching\ExpGPX\GC Luxembourg.gpx"
EXPORT Type=OZI  File="D:\Geocaching\ExpOZI\GC Luxembourg.wpt"

# Data for BeLuc - Split TTN3

FILTER Name="R BeLux Arc"
EXPORT Type=POI  File="D:\Geocaching\ExpTTN\GC BeLux Arc.ov2"
FILTER Name="R BeLux Found"
EXPORT Type=POI  File="D:\Geocaching\ExpTTN\GC BeLux Found.ov2"
FILTER Name="02 Traditional"
EXPORT Type=POI  File="D:\Geocaching\ExpTTN\GC BeLux Tra.ov2"
FILTER Name="02 Multicache"
EXPORT Type=POI  File="D:\Geocaching\ExpTTN\GC BeLux Mul.ov2"
FILTER Name="02 Mystery"
EXPORT Type=POI  File="D:\Geocaching\ExpTTN\GC BeLux Mys.ov2"
FILTER Name="02 Virtual"
EXPORT Type=POI  File="D:\Geocaching\ExpTTN\GC BeLux Vir.ov2"
FILTER Name="02 WebCam"
EXPORT Type=POI  File="D:\Geocaching\ExpTTN\GC BeLux Cam.ov2"

FILTER Name="NONE"

Macro for "Campaign"

# Campagne

FILTER Name="00 Campagne"
EXPORT Type=GPX  File="D:\Geocaching\ExpGPX\GC Campagne.gpx"
EXPORT Type=OZI  File="D:\Geocaching\ExpOZI\GC Campagne.wpt"
EXPORT Type=OZI  File="D:\Geocaching\ExpOZI\GC Campagne Park.wpt"
EXPORT Type=OZI  File="D:\Geocaching\ExpTTN\GC Campagne.ov2"
FILTER Name="NONE"

Link to comment

Here's my Outlook Macro:

 

Public Sub GetAttachments()
   On Error GoTo GetAttachments_err
   
   Dim ns As NameSpace
   Dim Inbox As MAPIFolder
   Dim SubFolder As MAPIFolder
   Dim DestFolder As MAPIFolder
   Dim Item As Object
   Dim Msg As MailItem
   Dim Atmt As Attachment
   Dim i As Integer
   Dim DoMove As Boolean
   
   Set ns = GetNamespace("MAPI")
   Set Inbox = ns.GetDefaultFolder(olFolderInbox)
   Set SubFolder = Inbox.Folders("Geocaching").Folders("ToProcess")
   Set DestFolder = Inbox.Folders("Geocaching").Folders("Processed")
   
   If SubFolder.Items.Count = 0 Then
       Exit Sub
   End If
   
   i = 0
   For Each Item In SubFolder.Items
       If TypeOf Item Is MailItem Then
           Set Msg = Item
           If Msg.Attachments.Count <> 0 Then
               DoMove = False
               For Each Atmt In Msg.Attachments
                   If Atmt.FileName Like "*.zip" Then
                       Atmt.SaveAsFile "C:\Documents and Settings\Cade\Desktop\Geocaching\" & Atmt.FileName
                       i = i + 1
                       DoMove = True
                   End If
               Next Atmt
               If DoMove Then
                   Msg.FlagIcon = olNoFlagIcon
                   Msg.FlagStatus = olNoFlag
                   Msg.Save
                   Msg.Move DestFolder
               End If
           End If
       End If
   Next Item
   
   If i > 0 Then
       MsgBox i & " attached files saved.", vbInformation, "Finished!"
   End If
   
GetAttachments_exit:
   Set Atmt = Nothing
   Set Item = Nothing
   Set ns = Nothing
   Exit Sub
   
GetAttachments_err:
   MsgBox "An unexpected error has occurred." _
   & vbCrLf & "Please note and report the following information." _
   & vbCrLf & "Macro Name: GetAttachments" _
   & vbCrLf & "Error Number: " & Err.Number _
   & vbCrLf & "Error Description: " & Err.Description, vbCritical, "Error!"
   Resume GetAttachments_exit
End Sub

 

Here's my batch file which creates a gsak script:

 

@echo off
:begin

echo # GSAK File Generated By Batch File >geoprep.gsak

if not exist 31327.zip goto next1
echo LOADING Unfound
echo LOAD File="C:\Documents and Settings\Cade\Desktop\Geocaching\31327 - Unfound.gpx" >>geoprep.gsak
del 31327*.gpx
wzunzip 31327.zip
ren 31327.gpx "31327 - Unfound.gpx"
del 31327.zip

:next1
if not exist 40314.zip goto next2
echo LOADING Watched
echo LOAD File="C:\Documents and Settings\Cade\Desktop\Geocaching\40314 - Watched Caches.gpx" >>geoprep.gsak
del 40314*.gpx
wzunzip 40314.zip
ren 40314.gpx "40314 - Watched Caches.gpx"
del 40314.zip

:next2
if not exist 40315.zip goto next3
echo LOADING New
echo LOAD File="C:\Documents and Settings\Cade\Desktop\Geocaching\40315 - New Caches.gpx" >>geoprep.gsak
del 40315*.gpx
wzunzip 40315.zip
ren 40315.gpx "40315 - New Caches.gpx"
del 40315.zip

:next3
if not exist 40940.zip goto next4
echo LOADING Found
echo LOAD File="C:\Documents and Settings\Cade\Desktop\Geocaching\40940 - Found Caches.gpx" >>geoprep.gsak
del 40940*.gpx
wzunzip 40940.zip
ren 40940.gpx "40940 - Found Caches.gpx"
del 40940.zip

:next4
if not exist 168193.zip goto next5
echo LOADING Found
echo LOAD File="C:\Documents and Settings\Cade\Desktop\Geocaching\168193 - New 2.gpx" >>geoprep.gsak
del 168193*.gpx
wzunzip 168193.zip
ren 168193.gpx "168193 - New 2.gpx"
del 168193.zip

:next5
if not exist 73297.zip goto next6
del 73297*.gpx
wzunzip 73297.zip
start 73297.gpx /wait
ren 73297.gpx "73297 - Cambridge.gpx"
del 73297.zip

:next6
if not exist 84588.zip goto next7
del 84588*.gpx
wzunzip 84588.zip
ren 84588.gpx "84588 - Miami.gpx"
del 84588.zip

:next7
if not exist 84983.zip goto next8
del 84983*.gpx
wzunzip 84983.zip
ren 84983.gpx "84983 - London.gpx"
del 84983.zip

:next8
if not exist 84985.zip goto next9
del 84985*.gpx
wzunzip 84985.zip
ren 84985.gpx "84985 - Waddesdon.gpx"
del 84985.zip

:next9
if not exist 106573.zip goto end
echo LOADING Orlando
echo LOAD File="C:\Documents and Settings\Cade\Desktop\Geocaching\106573 - Orlando Caches.gpx" >>geoprep.gsak
del 106573*.gpx
wzunzip 106573.zip
ren 106573.gpx "106573 - Orlando Caches.gpx"
del 106573.zip


:end
echo FILTER Name="Hitlist" >>geoprep.gsak
echo EXPORT Type=GPX File="C:\Documents and Settings\Cade\Desktop\Geocaching\hitlist.gpx" >>geoprep.gsak

"C:\Program Files\GSAK3\GSAK" /run "C:\Documents and Settings\Cade\Desktop\Geocaching\geoprep.gsak"

:finish

 

I know that technically you don't need to unzip the files, but I like to rename the original GPX files so I know the names and put them on my iPaq, too.

Link to comment

The following macro will generate a route of caches that are the closest distance from each other for a "cache raid"

 

Basically, the macro allows you to build a "cache chain". You select a cache then the macro will build a database of a direct route of the caches that are the shortest distance from last one (of course ignoring caches that are already in your "cache chain"). You can then use this "route" to plan your next cache raid. Note: this is not quite as sophisticated as selecting a centre point then doing the calculations to provide the shortest route to collect all caches within x miles of this point (I'm not even sure how I would do this).

 

This version just keeps on selecting the cache that is the next closest then adds it to the "cache raid" database. So depending what your starting cache is, and how many you want for this "cache raid" you could end up anywhere (of course you could always start by setting a filter that is x miles from your starting point to make sure you don't end up too far from your starting point)

 

Unfortunately, there is no looping (yet) in GSAK so you need to copy the requried block of code for as many caches as you want in your "cache chain". The sample macro will generate 5 caches in the chain, but of course you can change this to suit yourself.

 

The macro is quite convoluted but it does get the job done. It is also a good exercise to view the various commands used.

 

There are a few things you need to be aware of to get this version of the macro to work.

 

1. Create 2 new empty databases called "chain1" and "chain2"

2. Create 2 new Move/Copy settings called "chain1" and "chain2" (see pictures at the end)

3. You must have a saved filter called "User flag = set" and the only item in this filter should be user flag = set. (default filter shipped with GSAK)

4. Change the line just after "# select the starting database again" to reflect your starting database (mine was Clyde2)

 

# create a chain of waypoints starting at the currently selected one

# depending on your settings some of the following commands may not

# be required, however by putting these in this makes sure this macro

# will work no matter what your current sort sequence is or what settings

# you have

 

# remove the following # if you would like to see this macro execute one line at a time

#debug status=on

 

# first clear all user flags

userflag type=clear range=all

 

# set user flag for starting cache

userflag type=set range=1

 

# make sure the chain1 and chain2 databases are empty

Database name="chain1" action=delete

Database name="chain2" action=delete

Database name="chain1" action=create

Database name="chain2" action=create

 

# select the starting database again because the previouse create automatically changes the database

database name="clyde2"

 

# select a filter here (remove the #) if you don't want the whole database to be used in the cache chain

# Note: your starting waypoint must meet this filter condition also, otherwise the macro won't work.

# Filter name="my filter"

 

# copy over all waypoints in this subset to chain1 database

movecopy settings="chain1"

Database name="chain1"

 

#set center to the starting waypoint

filter name="user flag = set"

center

sort by="distance"

 

# now start moving waypoints to the chain2 database

goto position=top

userflag type=set range=1

filter name="user flag = set"

movecopy settings="chain2"

sort by="distance"

cancelfilter

goto position=top

center

 

goto position=top

userflag type=set range=1

filter name="user flag = set"

movecopy settings="chain2"

cancelfilter

sort by="distance"

goto position=top

center

 

goto position=top

userflag type=set range=1

filter name="user flag = set"

movecopy settings="chain2"

cancelfilter

sort by="distance"

goto position=top

center

 

goto position=top

userflag type=set range=1

filter name="user flag = set"

movecopy settings="chain2"

cancelfilter

sort by="distance"

goto position=top

center

 

goto position=top

userflag type=set range=1

filter name="user flag = set"

movecopy settings="chain2"

cancelfilter

sort by="distance"

goto position=top

center

 

# finally select the chain 2 database and sort in natural order

database name="chain2"

sort by="natural"

goto position=top

 

Chain1 move copy

 

chain1.jpg

 

Chain2 move copy

 

chain2.jpg

Edited by ClydeE
Link to comment

Clyde:

 

That macro is way cool, and rather clever, as well. I bumped it up to creating a string of 10 caches, and it's working as-advertised.

 

The only thing that seems a bit odd is that it generates an alert box on each pass through, that reads "Error: Filter contains 0 waypoints - it will now be cleared" - and the user has to acknowledge this - so, I have to sit here and watch it run, and hit enter 10 times - it would be nice if that alert could be supressed, at least in this context.

 

One more quick question: Once this macro completes, and GSAK is displaying the chain2 database with the (in my case, 10) 'chained' waypoints - what does the value in the distance column represent? The distance between the current cache, and the next one in the list - or vice versa? I can't quite make sense of it. Either way - it's definitely cool. Couple this feature with the new(ish) "Cache Density" option available in the HTML export, and you've got some pretty useful tools for designing a "cache raid", as you so appropriately put it. I sometimes think of them as a blitz, or a spree, or even a rampage... :)

 

If it's simply a matter of storage space, I would be happy to host a library of GSAK macros at http://www.gotwake.com/ - but the Forums and/or gsak.net are probably more suitable locations. Let me know if there's anything I can do to be of assistance, and...

 

Thanks!

Billy

Link to comment

Here's a fairly simple macro I use to process my incoming GPX files (PQs) by importing into GSAK, and then filtering and exporting to CacheMate, Streets and Trips, and even (optionally) the GPSr:

 

# Load directory of NotFound GPX files - includes database selection

LOAD  Settings=ClearLoadNotFound Database=NotFound

# Export ALL Not Found caches to CacheMate

EXPORT Type=CMT Settings=CMnotfound 

# Center on home

CENTRE Location=Home

# Apply "Close" filter - selecting < 1000 caches closest to home

FILTER Name=close

# Export to HTML

EXPORT Type=HTML Settings=HomeNotFound

# Export to Streets and Trips

EXPORT Type=SNT Settings=HomeNotFound

# Send to GPS receiver

PAUSE Msg="Is GPSr connected?"

EXPORT Type=GPS Settings=60CS

 

Of course, you would have to customize to match your database and settings names, etc. Nothing fancy, but it sure saves me a whole bunch of clicks! I've just started using the Thunderbird "Attachment Extractor" plug-in, which streamlines the process of downloading/saving the attachments - but I'm considering this a temporary fix, until Clyde adds POP support and (once again) further simplifies the whole process.

 

Let me know if you've got any questions,

Billy

Edited by SnoWake
Link to comment
The only thing that seems a bit odd is that it generates an alert box on each pass through, that reads "Error: Filter contains 0 waypoints - it will now be cleared" - and the user has to acknowledge this - so, I have to sit here and watch it run, and hit enter 10 times - it would be nice if that alert could be supressed, at least in this context.

What version of GSAK are you running? (Help=>About) This issue should have been resolved in the latest public release (5.1.1) available at http://gsak.net

 

One more quick question: Once this macro completes, and GSAK is displaying the chain2 database with the (in my case, 10) 'chained' waypoints - what does the value in the distance column represent?

 

Unfortunately the distance really doesn't have any relation to the "cache raid". As always the distance column is just the distance from your current centre point which is probably the first cache in the raid.

 

If it's simply a matter of storage space, I would be happy to host a library of GSAK macros at http://www.gotwake.com/ - but the Forums and/or gsak.net are probably more suitable locations. Let me know if there's anything I can do to be of assistance, and...

No, storage is the least of my problems. Like many other new features it is a matter of time for me being able to implement this. I guess I could just set up FTP access to an area people could share macros, however I think users are expecting a bit more. Ideally, I would like to set up some web interface that allows uploading, perhaps with a short narrative explaining what the macro will do, then display all the macros and allow downloading. However, If anyone would like to set this up I can give FTP access to a directory on my website to test this out.

Link to comment

One more, even more simplistic macro:

 

My "found" PQs come in three chunks, to get them all returned under the 500-cache-per-PQ limit (I may have to go to four, soon). Again, I extract all the PQs into a particular directory, and then run the following script, which pulls them into my Found database, exports to Streets and Trips, does a MOVECOPY to a Report database. At that point, I'd like to purge all the logs except my own - resulting in an HTML "journal" of sorts - of my finds, in chronological order, which only my log entries displayed (as seen here: http://www.gotwake.com/caches/foundMy Caching Journal

 

Don't hesitate to ask if you have any questions on filter or export settings that go along with either of these macros. Next will be to automate my "Tahoe Arc" process, where I pick out all the caches within 2 miles of my route on weekly commute from the Bay Area to Lake Tahoe. Very cool getting these things down to a single macro... make that Menu Bar Button Click!

 

# Load directory of NotFound GPX files - includes database selection

LOAD  Settings=found Database=found

# Export to Streets and Trips

EXPORT Type=SNT Settings=found

# Copy the waypoints to the Reports Database

MOVECOPY Settings=Report

# Hmmm - no purge function via Macro commands?
# At least, not the purge I'm looking for (PURGENOTE is different)
# Perform this step manually for now

# Export to HTML 'journal'

EXPORT Type=HTML Settings=Found

 

Nothing very fancy here - but with the frequency that I perform this task, it still saves me measurable time.

 

Have a great evening,

Billy

Link to comment
What version of GSAK are you running? (Help=>About) This issue should have been resolved in the latest public release (5.1.1) available at http://gsak.net

 

I'm running 5.1.1. Help->About shows: 5.1.1 (Build 14)

 

Unfortunately the distance really doesn't have any relation to the "cache raid". As always the distance column is just the distance from your current centre point which is probably the first cache in the raid.

 

Interesting - in my case, each time I've run it, selecting different starting caches - the "center point" as displayed in the bottom status bar is not one of the caches in the raid. I'm wondering if it might be the "next" cache? Haven't really walked through the logic, nor am I that concerned - it just caught my eye. At first, I thought it was just incrementing, like a "route distance" or something - but then realized that wasn't the case. No big deal, at all - I was just curious.

 

No, storage is the least of my problems. Like many other new features it is a matter of time for me being able to implement this. I guess I could just set up FTP access to an area people could share macros, however I think users are expecting a bit more. Ideally, I would like to set up some web interface that allows uploading, perhaps with a short narrative explaining what the macro will do, then display all the macros and allow downloading. However, If anyone would like to set this up I can give FTP access to a directory on my website to test this out.

 

Well, the PostNuke content management system I use provides a download section, complete with categories, ratings, links, etc. I'm just using the "out-of-the-box" one right now, but there are enhanced ones that provide more functionality (remote user uploads, etc). I would certainly be more than happy to provide such a service, if it were deemed valuable. On the other hand, I wouldn't bother taking the time to configure it if everyone is just as happy posting them here...

 

Whaddya think?

Billy

Link to comment
My "found" PQs come in three chunks, to get them all returned under the 500-cache-per-PQ limit (I may have to go to four, soon).

I'm going to hijack this thread for a minute. I got caught by a pocket query that grew to over 500 caches with out me realizing it as I import multiple PQ files ( a folder of 4) to get the "Not Found" caches that I'm interested in. The PQ's are overlapping circles and I just let GSAK eliminate any duplicate caches.

 

Clyde would it be possible to setup GSAK to give a warning when a Pocket Query file has 500 caches?

 

To bring this back on topic if GSAK did this I'm not sure how it would work in macros where dialogue boxes are suppressed.

 

We now return you to your regularly scheduled programming :)

Link to comment
I'm going to hijack this thread for a minute.  I got caught by a pocket query that grew to over 500 caches with out me realizing it as I import  multiple  PQ files ( a folder of 4) to get the "Not Found" caches that I'm interested in.  The PQ's are overlapping circles and I just let GSAK eliminate any duplicate caches.

 

Clyde would it be possible to setup GSAK  to give a warning when a Pocket Query file has 500 caches?

 

I'll have to give that one some thought. The whole idea of macros is to suppress all error/warning messages. Also GPX files can come from other sources or generated "in house" by utilities such as GPSBabel and GSAK itself.

 

SnowWake - I just tried the macro and did not get any of the message boxes you describe. Could you please send me as screen shot of this warning message so I can track down exactly where it is comming from.

Edited by ClydeE
Link to comment
I'll have to give that one some thought. The whole idea of macros is to suppress all error/warning messages. Also GPX files can come from other sources or generated "in house" by utilities such as GPSBabel and GSAK itself.

I was wondering about something similar to the "Send to GPS" function where it warns if you try to send more than 500 (or whatever value is set in the GPS Setup).

 

I supose I could do this by importing the PQs individually to a separate database then move them individually to the final database with the replace and add options set.

Link to comment
I got caught by a pocket query that grew to over 500 caches with out me realizing it as I import multiple PQ files ( a folder of 4) to get the "Not Found" caches that I'm interested in.

 

A while back I got caught by the same thing. I had the waypoint in my GPS but for some reason didn't have it in my PDA loaded with descriptions. Took me a while to figure it out. The waypoint was previously loaded when the pocket query was less than 500. As the caches grew, I downloaded the latest pocket query to my PDA and it wasn't included because the file had grown to over 500 and this happen to be the one that wasn't included.

 

I spent a great deal of time tweaking my pocket queries so that I could get ALL waypoints downloaded that were within 100 mile radius of my home. I used the preview function of the pocket queries to see how many were in each one. I finally had to divide them up by difficulty and terrain settings to be able to get all of them. It was NOT an easy task figuring out how to get them all.

 

I get 5/day that have all of my unfound caches within 100 mile redius. Once a week I have it set to download my "finds" so that my GSAK database remains current with GC.com

 

Gary

Link to comment
I spent a great deal of time tweaking my pocket queries so that I could get ALL waypoints downloaded that were within 100 mile radius of my home.  I used the preview function of the pocket queries to see how many were in each one.  I finally had to divide them up by difficulty and terrain settings to be able to get all of them.  It was NOT an easy task figuring out how to get them all.

I also use the preview function to check on the size of the PQ's ( it's a pain) but was hoping that GSAK could automate this. As for setting up PQ's to catch all the caches of interest without exceeding the magic 500 limit I agree it's also a pain.

 

There's another thread on some innovative ways of doing this by date placed and other criteria rather than location which I'm using. I'll have to try them out. Hopefully the improvements to Pocket Queries such as the "Bounding Box" discussed here will come sooner rather than later.

Link to comment

Since we are talking about macros... and since looping is probably on the horizon: here is a macro that I want to be able to run on my cummulative data so as to fix any archive/unavailable flags that are out of date:

Select database...
Select filter...
Activate split screen (initialize browser inside GSAK display)
Loop through active filter - for each record do the following:
 Display on-line version of current record
 Extract off the html code <span id=ErrorText>...</span> to buffer
 Set current record status to "available"
 If the word “unavailable” shows up in this buffer
    then change record status to “unavailable”
 If the word “archived” shows up in this buffer 
    then change record status to "archived"
 Pause a few seconds (to prevent throttling at GC.com)
 Clear buffer
 Advance pointer to next record in filter
 End of loop
Exit macro

I could see a lot of use in having the ability to pull stuff from various other <span ID=...> items off the on-line page.

Link to comment

Bump :ph34r:

 

There's a nice GSAK macro along with some .bat files and a WinBatch file which together allow you easily get your caches into Street&Trips. The process is described in this thread along with links to download the files required.

 

With this you can filter your GSAK database for different types of caches, export the csv files required by Streets&Trips then automatically have them imported into Streets&Trips with different icons assigned for each type.

Link to comment

Wow, thanks PDOP for pointing this out! Xangxa has done a great job.

 

I've been learning the macros for GSAK and I am thrilled with the results. (Thanks Clyde) Now when I get a phone call I can click and get out the door with a fresh batch of info faster than I can get my boots on!

 

I have MS S&T but haven't used it much in the past - other than trying to refine a route that we might take. This certainly has put the program back up on my list of necessary software for the laptop in the car.

Link to comment

Macro's and/or automating tasks in GSAK are probably way over my :) head but thought I would give it a go. Not sure if this is really on topic for macros or if it is something for the "run program" feature of GSAK.

 

I would like to automatically run USAPhotomaps to bring up the individual cache, hopefully with a waypoint icon of my choosing, and the GSAK generated code to label the waypoint (I drop the GC in the code).

 

Anyway to do this?

 

Thanks,

 

Pen of Pen&Card

Link to comment
Macro's and/or automating tasks in GSAK are probably way over my :rolleyes: head but thought I would give it a go. Not sure if this is really on topic for macros or if it is something for the "run program" feature of GSAK.

 

I would like to automatically run USAPhotomaps to bring up the individual cache, hopefully with a waypoint icon of my choosing, and the GSAK generated code to label the waypoint (I drop the GC in the code).

 

Anyway to do this?

 

Thanks,

 

Pen of Pen&Card

I've tried viewing your link on different days, but I get a "Web site not found" each time.

Link to comment

There's another thread on some innovative ways of doing this by date placed and other criteria rather than location which I'm using. I'll have to try them out. Hopefully the improvements to Pocket Queries such as the "Bounding Box" discussed here will come sooner rather than later.

Where is the thread for tweaking PQs? I can't seem to locate it with a search.

Link to comment

This one discusses it a bit. Basically the logic is that a search by a set radius will return increasingly more caches over time as more caches are placed. Eventually it will exceed the limit of 500 without you knowing. The results of a search by date placed will remain static or decrease over time so it will never exceed 500.

 

I don't know that it's any easier to do the initial setup by date placed but once it's done it should be maintenance free.

 

Edit: Here's the one I was referrring to.

Edited by PDOP's
Link to comment
This one discusses it a bit. Basically the logic is that a search by a set radius will return increasingly more caches over time as more caches are placed. Eventually it will exceed the limit of 500 without you knowing. The results of a search by date placed will remain static or decrease over time so it will never exceed 500.

 

I don't know that it's any easier to do the initial setup by date placed but once it's done it should be maintenance free.

 

Edit: Here's the one I was referrring to.

Thanks, big help however this leads to another question;

 

Is there a limit on number of miles?

 

In otherwords, if I do the date method, but instead of a state I want to set it to a radius around my house of say 150, 200 or even 500 miles, is there a limit? I have set it to higher numbers but have had some weird and inconsistant results.

Link to comment
QUOTE (Pen&Card @ Mar 13 2005, 01:25 PM)

Macro's and/or automating tasks in GSAK are probably way over my  head but thought I would give it a go. Not sure if this is really on topic for macros or if it is something for the "run program" feature of GSAK.

 

I would like to automatically run USAPhotomaps to bring up the individual cache, hopefully with a waypoint icon of my choosing, and the GSAK generated code to label the waypoint (I drop the GC in the code).

 

Anyway to do this?

 

Thanks,

 

Pen of Pen&Card

Xangxa Posted on Mar 16 2005, 05:37 AM

I've tried viewing your link on different days, but I get a "Web site not found" each time.

Well, that's because I gave you the wrong link. Sorry about that. Try http://jdmcox.com/ or this link USAPhotomaps

Link to comment

With the release of GSAK 5.5 I can post my extra super-duper Cache Logging macro for taking finds from Cachemate on your Palm directly into GC.com's logging pages. It's very user-friendly - just run it and answer the questions. There's only one requirement: you need to have a filter to show only Found caches, else you'll find yourself logging all sorts of caches that you haven't found. The setup dialogs will take you through it.

 

If you're NOT running Windows XP, you may need to change each instance of C:\Windows\ to match your own Windows location - on Win2K it should be "C:\WINNT\" but otherwise should work.

 

Please advise if you have problems - about the only way the beta group has found to break it is to give it a bad Finds filter name, since there's no way (yet) for the macro language to check for the existence of a filter.

 

(Edited to remove macro code - use the one 4 posts below instead.)

Edited by Pasha
Link to comment

This is a rather simple macro by comparison to some of these -

 

This Macro allows you to select a single cache around which you can name a distance to find caches. Useful for getting a number of caches around a single one when going out to grab a bunch in one day.

 

Usage - clear all user flags and set one then run the macro.

 

Requires filter called "Single-Checked" The filter is set for Set User Flags only.

 

Requires filter called "2MileRadius-UnFound"

- three items in this filter all on General page

- 1 - Distance = 2 miles (you can adjust this for the

--- - actual distance you want to deal with or adjust for the number of caches)

- 2 - Found status = Not found and exclude mine

- 3 - Available Status = available only

 

Macro Follows

============================

CANCELFILTER

 

# load filter - single checked chache

FILTER name="Single-Checked"

 

# set current single cache as center

Center

 

FILTER name="2MileRadius-UnFound"

 

sort by="distance" sequence=A

 

goto position=top

 

Edited by CompuCash
Link to comment

this is the one I use for uploading to my Garmin -

 

Combines 3 filters

 

First is a filter called "Mine" which filters only my own caches

Second is a filter called "Unfound-Available"

Third is "User flag set"

 

These should be pretty obvious

 

The macro filters the first to setting flags as it goes then filters on the flags

 

to give me Mine and all avail. and unfound.

 

it then exports to a Saved Garmin export called "Garmin"

 

Obviously the GPS has to be on and plugged in to the computer.

This file gives you the ability to set up for YOUR GPS without changing the macro.

I have three of these - One for serial and one for USB Garmin and one for Magellan.

 

#

# Combine 2 filters and send to GPS

#

# clear all user flags first

USERFLAG type=clear range=all

 

# load first filter - mine and available

FILTER name="Mine"

 

# set user flags for this filter

USERFLAG type=set range=filter

 

# load second filter

FILTER name="Unfound-Available"

 

# set user flags for this filter

USERFLAG type=set range=filter

#

# now finally set a filter on User flags = set

FILTER Name="User flag set"

#

# Send waypoints to GPS

#

EXPORT type=gps settings="Garmin"

Link to comment

This last macro does an export to Delorme format to add the caches from the latest PQ to my Delorme Topo. After running this I just import it into topo.

 

requires filter called "Mine+NotFound" -- pretty obvious

 

requires export file called "Delorme"

 

This allows you to set any export you want.

 

Don't forget that the export file needs a full path in the export dialog. This macro will over write any previous version of the file without asking.

 

 

CANCELFILTER

 

# load filter - all mine and not found

FILTER name="Mine+NotFound"

 

# Export to Delorme

Export Type="DEL" Settings="Delorme"

 

#Export to D:\Downloads\GPS\GSAK-Out\Caches.txt (will over write the file)

 

Link to comment

Unfortunately (or fortunately if you haven't tried it yet) a user pointed out a bug in my monster logging macro. It should only manifest if you try to set the saved Cachemate settings value to "none". The below code will take care of that. If you've already run the one above, you'll need to delete the "logem.dat" file in your GSAK\Macros folder before running this one. If you haven't seen any errors, don't bother replacing the old one.

#############################################
# Macro to get the latest copy of Cachemate's
# backup database, extract the finds, update
# the local copy, then sequentially (by found
# date and distance from home) open the
# GC.com logging page with the user notes
# from the local record copied into the
# clipboard. Once logging is complete, finds
# are moved to another database if the user
# has defined that.
#
# REQUIRED: you must have a filter to
# separate your "found" caches from the rest,
# with (at least) "Found" checked under Found
# Status - else you're going to be logging
# non-finds.
#############################################
Debug Status=Off

# Data file path
SET $datafile=$_Install + "\Macros\Logem.dat"

# Does it already exist?
IF (FileExists($datafile))

   # Yes? Read config values and assign to our vars
   SET $vars=GETFILE($datafile)
   IF Left($vars, 7) = "*Error*"
       PAUSE Msg="Unable to read $datafile!
   ENDIF
   SET $database=EXTRACT($vars, ";", 1)
   SET $cm2gpx=EXTRACT($vars, ";", 2)
   SET $cm2options=EXTRACT($vars, ";", 3)
   SET $findsgpx=EXTRACT($vars, ";", 4)
   SET $cmsettings=EXTRACT($vars, ";", 5)
   SET $pdbfile=EXTRACT($vars, ";", 6)
   SET $findsfilter=EXTRACT($vars, ";", 7)
   SET $movecopysettings=EXTRACT($vars, ";", 8)

ENDIF

IF .NOT. (FileExists($datafile))

   # No?  Then we have to ask for the various values and check to see if they're valid.

   # Database in which to import finds
   SET $database="Default"
   SET $inputmsg="Enter the name of the datase to which to import finds from Cachemate"
   INPUT Msg="$inputmsg" Default="$database" Varname=$database
   WHILE .NOT. (DataBaseExists($database))
       SET $inputmsg="That database doesn't exist! Enter a valid database name:"
       INPUT Msg="$inputmsg" Default="$database" Varname=$database
   ENDWHILE

   # Location of cm2gpx.exe
   SET $cm2gpx=$_Install + "\cm2gpx.exe"
   WHILE .NOT. (FileExists($cm2gpx))
       SET $inputmsg=$cm2gpx + " not found." + $_NewLine + "Enter fully-qualified path to CM2GPX.exe"
       INPUT Msg="$inputmsg" Default="$cm2gpx" Varname=$cm2gpx
   ENDWHILE

   # cm2gpx.exe command line options
   SET $cm2options="-f"
   SET $inputmsg="Enter cm2gpx.exe command-line options." + $_NewLine + $_NewLine + "(The default is to only import records in the 'Found' category. See the cm2gpx help for more information.)"
   INPUT Msg="$inputmsg" Default="$cm2options" Varname=$cm2options

   # GPX file to write
   SET $findsgpx=$_Install + "\Macros\newfinds.gpx"
   SET $inputmsg="GPX file to write:" + $_NewLine + $_NewLine + "(The default should work for any installation.)"
   INPUT Msg="$inputmsg" Default="$findsgpx" Varname=$findsgpx

   # Saved "Load Cachemate logs and finds" settings name, if any
   SET $cmsettings="New Finds"
   SET $inputmsg="Saved 'Load Cachemate logs and finds' settings name" + $_NewLine + $_NewLine + "(If you don't have one, delete this value and we'll use the defaults.)"
   INPUT Msg="$inputmsg" Default="$cmsettings" Varname=$cmsettings

   # Cachemate database backup file to grab finds from
   SET $pdbfile="C:\PROGRA~1\palmOne\YOUR PALM USERNAME\Backup\DEFAUL~1.PDB"
   SET $inputmsg="Cachemate database file to grab finds from:" + $_NewLine + $_NewLine + "(Change YOUR PALM USERNAME to match your backup location, and change DEFAUL~1.PDB to match the PDB file to want, if different."
   INPUT Msg="$inputmsg" Default="$pdbfile" Varname=$pdbfile
   WHILE .NOT. (FileExists($pdbfile))
       SET $inputmsg="No such file exists!" + $_NewLine + "Cachemate database file to grab finds from:" + $_NewLine + $_NewLine + "(Change YOUR PALM USERNAME to match your backup location, and change DEFAUL~1.PDB to match the PDB file to want, if different."
       INPUT Msg="$inputmsg" Default="$pdbfile" Varname=$pdbfile
   ENDWHILE

   # Filter name to only show found statuses.  Crucial if you don't want to log LOTS of caches you haven't found.
   SET $findsfilter="Found"
   SET $inputmsg="'Finds' filter name:" + $_NewLine + $_NewLine + "(You MUST have a filter that shows only records with a 'Found' status, else you'll be logging LOTS of caches you haven't found yet.)"
   INPUT Msg="$inputmsg" Default="$findsfilter" Varname=$findsfilter

   # Move/Copy saved settings name
   SET $movecopysettings="Found"
   SET $inputmsg="Move/Copy saved settings name:" + $_NewLine + $_NewLine + "(If you don't want to move or copy your new finds to a different database after logging, delete this value.)"
   INPUT Msg="$inputmsg" Default="$movecopysettings" Varname=$movecopysettings

   # Now save all those values for next time into $datafile, separated by;
   # If there's blanks
   SET $vars=$database + ";" + $cm2gpx + ";" + $cm2options + ";" + $findsgpx + ";" + $cmsettings + ";" + $pdbfile + ";" + $findsfilter + ";" + $movecopysettings
   SET $result=PUTFILE($datafile, $vars)
   IF Left($result, 7) = "*Error*"
       CANCEL Msg="Unable to write to $datafile!"
   ENDIF
   
# End "No $datafile" IF
ENDIF

# Whew.  Now we can actually do something with all those vars:

# Select the database
DATABASE Name="$database" Action=Select

# Create a batch file to run cm2gpx to get around the inability to put quotes into a RUNPGM line
SET $batfile=$_Install + "\cm2gpx.bat"
SET $battext=$cm2gpx + " " + $cm2options + " -o " + $findsgpx + " " + $pdbfile
SET $result=PUTFILE($batfile, $battext)
IF Left($result, 7) = "*Error*"

   # If we can't create the batch file, we have to cancel.
   CANCEL Msg="$result"
ENDIF

# Run the batch file to create $findsgpx
RUNPGM Pgm="$batfile" Wait=Yes

# If the user hasn't defined a saved Cachemate setting, use the defaults.
IF $cmsettings = ""
   CACHEMATE File="$findsgpx"
ENDIF

# If they've defined one, use it instead
IF .NOT. ($cmsettings = "")
   CACHEMATE Settings="$cmsettings" File="$findsgpx"
ENDIF

# Filter so our list is only new finds
FILTER Name=$findsfilter

# If there's records in the filter, sort 'em and log 'em, pausing between each for the user to confirm.
IF .NOT. ($_FilterCount = 0)
   CENTRE Location="Home"
   SORT By="FoundByMe;UserSort"
   WHILE .NOT. $_EOL
       CLIP tags="%UserLog"
       WEB url="http://www.geocaching.com/seek/log.aspx?ID=%gcid"
       PAUSE Msg="Click Continue when logged successfully."
       GOTO Position=Next
   ENDWHILE
   
   # If the user has defined $movecopysettings, use them.
   IF .NOT. ($movecopysettings = "")
       MOVECOPY Settings=$movecopysettings
   ENDIF
ENDIF

# Done with everything.  Remove the batch file and the GPX file.
RUNPGM Pgm="C:\Windows\System32\cmd.exe" Parms=" /C del $batfile"
RUNPGM Pgm="C:\Windows\System32\cmd.exe" Parms=" /C del $findsgpx"

Link to comment

So, I wrote a fairly simple macro to import my PQ's from my mail and then separate everything out. What I'm having problems with is when I want to sort out my DNF's. When I run the macro and there's no DNF's, it defaults to the WP's in the existing DB and then moves them ALL to the DNF DB. It's the same as getting one of these errors

 

gsak_error.jpg

 

And then having GSAK revert back to the pre-existing DB that you were trying to filter from.

 

Here's the code for the Macro. Any help on being able to actually use the DNF Filter and MOVECOPY commands w/o moving the whole DB when I don't have a DNF come in on my PQ would be most appreciated.

 

#################################################################
# UPDATE HISTORY	
#################################################################
#      	
# 05.05.05 - Added Filtering and DB Management for caches near	
#            Mom & Dad.  Added UPDATE HISTORY header.  
#        
# 05.01.05 - Fine tuned Filtering and sorting features  
#        
# 04.29.05 - Macro creation date    
#        
#################################################################

# Select Default DB
DATABASE Name="Default" Action=select

# Get PQ's from POP3 Mail
GETMAIL Settings="Earthwake_Mail" OnError=Prompt

# Filter out all the 'Found' Caches
FILTER Name="My Found Caches (GSAK default)" Reverse=No

# Move the 'Found' Caches to the Found DB
MOVECOPY Settings="Found_Caches"

#################################################################
# For future release once OWNED Caches are introduced  
#################################################################
# # Return to Default DB    	
# DATABASE Name="Default" Action=select    
#        	
# # Filter out all the 'Owned' Caches    
# FILTER Name="My Owned Caches (GSAK default)" Reverse=No	
#        	
# # Move the 'Owned' Caches to the Owned DB  	
# MOVECOPY Settings="Owned_Caches"    
#################################################################

# Return to Default DB
DATABASE Name="Default" Action=select

# Filter out all Massachusetts Caches
FILTER Name="Massachusetts" Reverse=No

# Move the MA Caches to the Mom & Dad DB
MOVECOPY Settings="Wrentham"

# Return to Default DB
DATABASE Name="Default" Action=select

# Filter out all Rhode Island Caches
FILTER Name="Rhode Island" Reverse=No

# Move the MA Caches to the Mom & Dad DB
MOVECOPY Settings="Wrentham"

# Return to Default DB
DATABASE Name="Default" Action=select

#################################################################
# For future consideration if DNF Caches become a major concern 
#################################################################
# #Filter out all the 'DNF' Caches    
# Filter Name="DNF" Reverse=No    	
#        
# # Move the 'DNF' Caches to the DNF DB    
# MOVECOPY Settings="DNF"    	
#        
# # Return to Default DB    	
# DATABASE Name="Default" Action=select    
#################################################################

 

The only way I can think of doing this is to add the DNF FILTER and MOVECOPY commands and then go to the DNF DB, run a reverse DNF FILTER and MOVECOPY that subset BACK to the default DB. That's a ton of work though. :D

Edited by LBSurfer
Link to comment
So, I wrote a fairly simple macro to import my PQ's from my mail and then separate everything out.  What I'm having problems with is when I want to sort out my DNF's.  When I run the macro and there's no DNF's, it defaults to the WP's in the existing DB and then moves them ALL to the DNF DB.  It's the same as getting one of these errors

 

[

The only way I can think of doing this is to add the DNF FILTER and MOVECOPY commands and then go to the DNF DB, run a reverse DNF FILTER and MOVECOPY that subset BACK to the default DB.  That's a ton of work though. :D

What version of GSAK are you running?

 

Version 5.5 intoduced many new features that allow you to handle this type of situation.

 

When you do a filter, GSAK sets a system variable called $_FilterCount. All you need to do is use this variable in an if statement:

 

#Filter out all the 'DNF' Caches    
Filter Name="DNF" Reverse=No  

# Only do the following statements if filter has waypoints     
If $_FilterCount > 0 
  # Move the 'DNF' Caches to the DNF DB    
  MOVECOPY Settings="DNF"     
ENDIF
   
# Return to Default DB     
DATABASE Name="Default" Action=select    

Edited by ClydeE
Link to comment
So, I wrote a fairly simple macro to import my PQ's from my mail and then separate everything out.  What I'm having problems with is when I want to sort out my DNF's.  When I run the macro and there's no DNF's, it defaults to the WP's in the existing DB and then moves them ALL to the DNF DB.  It's the same as getting one of these errors

 

[

The only way I can think of doing this is to add the DNF FILTER and MOVECOPY commands and then go to the DNF DB, run a reverse DNF FILTER and MOVECOPY that subset BACK to the default DB.  That's a ton of work though. :anibad:

What version of GSAK are you running?

 

Version 5.5 intoduced many new features that allow you to handle this type of situation.

 

When you do a filter, GSAK sets a system variable called $_FilterCount. All you need to do is use this variable in an if statement:

 

#Filter out all the 'DNF' Caches    
Filter Name="DNF" Reverse=No  

# Only do the following statements if filter has waypoints     
If $_FilterCount > 0 
  # Move the 'DNF' Caches to the DNF DB    
  MOVECOPY Settings="DNF"     
ENDIF
   
# Return to Default DB     
DATABASE Name="Default" Action=select    

Thanks Clyde...I knew it was just something simple I was missing. (I'm running the latest version btw). Much, much appreciated.

Link to comment

I'm having trouble getting a GSAK 5.6.0 macro to kickoff Plucker. I've tried many combinations of pgm and parms, and nothing seems to work. The most common error is that the channel names don't exist in the .ini file.

 

Does anyone have a concrete example that works? Thanks!

Edited by martinp13
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Followers 17
×
×
  • Create New...