Jump to content

Automating Gsak


Kai Team

Recommended Posts

The automation built into GSAK 4.1 is great! It’s fairly simple and the rewards are high: with one double click, I now load my latest Pocket Query into GSAK, filter it and export the results to my GPSr, MapSource and my Palm Pilot. I’m instantly able to plan my next outing in MapSource, and the GPSr and Palm Pilot have all the information I need, all with a single double click of the mouse (and a press of the Palm HotSync button)! I've also customized my exports so that all three have the same information (e.g. waypoint name) the way I want it (e.g. GC waypoint code without the leading "GC").

 

I hadn’t created a batch file since the days of MSDOS (I know, I’m dating myself) and decided to start this thread to share what I learned with others interested in automating GSAK for the first time, and to encourage those with more experience to share their GSAK automation tips.

 

The basic approach took me about an hour and involved:

 

1) Open GSAK and manually create and save any filter(s) you want to use. Skip this step is you already have your desired filters saved.

 

2) Manually perform any exports from GSAK that you want to use so that you can choose the options you want (GSAK automation uses the same options last used – i.e. if you want it to open MapSource when an mps file is exported, or load the pdb file into the Palm install tool, or name the waypoints in a certain way, all you have to do is manually run exports with those options selected). Skip this step if you already have exports set up the way you want them.

 

3) Use a plain text editor (like Notepad, which comes with Windows) to create a GSAK commands (macro) file. This is the most complicated part, but isn’t that complicated.

 

4) Use a plain text editor to create a batch file with the GSAK run command and name of the macro file you created in step 3 (this is very simple).

 

5) Create a desktop shortcut to the batch file (very simple).

 

I’ll skip manually creating the GSAK filters and exports, and move right into the automation part:

 

3) Create the GSAK commands file:

 

GSAK commands are explained in GSAK help, under “Miscellaneous Features” “Automating GSAK”. The commands file can be saved with any name and the “txt” extension – my file is named “GSAK_Commands.txt”. The paths and filenames shown below in italics will be unique to what you call things and where you save them on your computer. The commands file I created is listed below (lines preceded by # are comments that don’t do anything):

 

# Load latest pocket query

LOAD file="C:\My Documents\My Pocket Query.gpx"

# Filter for available caches that I have not found.

FILTER Name="Available_Caches"

# Export to MapSource

Export Type=MPS File="C:\My Documents\My Pocket Query.mps"

# Prompt to connect GPSr, then export to GPSr

PAUSE Msg="Connect the GPSr and turn it on before clicking 'OK'"

Export Type=GPS

# Export to Cachemate and remind me to HotSync.

Export Type=CMT File="C:\My Documents\My Pocket Query.pdb"

PAUSE Msg="Remember to HotSync the Palm Pilot!"

EXIT

 

“Available_Caches” is the name of the filter I manually created and saved in GSAK. The PAUSE command and MapSource export are new to GSAK v4.1 (thanks Clyde - it just keeps getting better!).

 

4. The batch file is easy. It can be named anything with a “bat” extension (mine is called “AutoGSAK.bat”). It contains three lines:

 

CD \Program Files\GSAK\

gsak /run "C:\My Documents\GSAK_Commands.txt"

EXIT

 

The first line goes to the folder where GSAK.exe is kept (the folder noted above is the default location under Windows), the second line starts GSAK and runs the commands in “GSAK_Commands.txt”, and the third line closes the window the batch file runs in.

 

5. To create a desktop shortcut to your new batch file, open Windows Explorer, navigate to the folder where you saved the batch file and right click on the file (AutoGSAK.bat in this case) and drag it to your desktop. When asked whether to copy, move or create a shortcut, choose “Create Shortcut”.

 

Double click the desktop shortcut you created, sit back and enjoy the fruits of your labor! :lol:

Link to comment

What version of GSAK are you using? The latest version4.1.2 (and versions since 4.1.0) have include a USB fix.

 

"Note: This version ships with GPSBabel version 1.2.4_beta07242004 which amongst other additions, has fixes for communication problems with USB to serial adapters"

Link to comment
What version of GSAK are you using? The latest version4.1.2 (and versions since 4.1.0) have include a USB fix.

 

"Note: This version ships with GPSBabel version 1.2.4_beta07242004 which amongst other additions, has fixes for communication problems with USB to serial adapters"

I don't think (from other posts I've seen on it) that the GPSBabel release that contains USB support is out there yet. If it's USB to serial adapters, that's not the same as USB support. If it's the USB to serial adapters, the PC is communicating to the serial adapter and GPSBabel did that already (albeit with some differences I suppose in the latest release).

 

When it says GPSBabel with Garmin USB support, then it should be good for those that don't have any serial connection and a pure USB connection from the GPS to the PC.

Link to comment
This is really grreat.  If I could get my Garmin etreX Vista C to communicate with GSAK I would take the time to digest your info.  How the heck can I get GSAK to recognize a USB versus a COM port???

 

Thanks,

PC neophyte,

Seasick Sailor

At this point, unless you contributed to the GPSBabel - Garmin USB research, GPSBabel and therefore GSAK don't communicate over the USB with Garmin GPSr. Meanwhile you have to use the Mapsource workaround. When you received you Garmin you also should have a CDRom with Mapsource Trips and Waypoint Manager. With this loaded it is easy to export from GSAK to this program and download from there. Several posts in the GSAK Topics explain how to do this, but if you can't find one, I can repeat it here. Once you get it setup right it only takes a few mouse clicks to get you waypoints downloaded.

 

Cache Well

 

Edited to add: Clyde is working to incorporate this function and has stated it will be in release 4.2 coming soon.

Edited by LordSaw
Link to comment

Here's my DOS batch file - it actually creates a custom GSAK script every time based on what it sees needs to be done. It uses WinZip command line tool to unzip the new file. It automatically renames the files so I can tell what they are on my iPaq and ONLY imports the file the first time (saving processing time).

 

There's better and easier ways to do this if you generally have a lot more files (like a perl script with a list of filesnames, but my PQs are pretty consistent, and I haven't spent much time on this):

 

@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 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

Link to comment

Interesting topic Kai Team, and thanks for sharing - the resourcefulness of GSAK users never cease to amaze me. :lol:

 

GSAK automation is fairly basic but as you have found out it can still be very powerful.

 

Feedback I am getting is that quite a few people use this feature (Even though it was originally just an afterthought) so I will continue to enhance, and add more commands and options.

 

One such enhancement will be the ability to set dialog options from the macro. This will enable you to control any option the corresponding export dialog contains before doing the actual export.

 

There are also other atomation changes in the pipeline, so stay tuned ….

Link to comment

Clyde,

 

I love GSAK.

 

As you can tell from my script above, I always export my updated hitlist anytime I run my prep batch file. Now, if a new cache shows up, and I haven't already put it in my hitlist, then it will not be exported, so I always have to run by "unfound nearby" filter, check to see if there are any new caches, and if there are, then mark them and re-export my hitlist.

 

I think one thing which would be useful (and maybe can already be done) is to be able to automate that part.

 

I know there is a mark new/updated caches, but I don't want to do that on all the PQs I'm bringing in, nor do I want to mark any which aren't in a particular filter.

 

Thanks,

 

Cade

Link to comment
One such enhancement will be the ability to set dialog options from the macro. This will enable you to control any option the corresponding export dialog contains before doing the actual export.  There are also other atomation changes in the pipeline, so stay tuned ….

 

We appreciate your continuing efforts, Clyde! Being able to set dialog options through the macro will be a great enhancement.

 

It isn't much of an issue for me right now because I tend to be a creature of habit - once I find a set up that I like, I don't often change it. I would still add the options once they're available. If I forget that I ran a manual operation with different options, I don't waste my time wondering what's suddenly wrong with my macro the next time I run Auto GSAK (nothing, which is why it would be a waste of my time!).

 

We will stay tuned...

 

Here's my DOS batch file - it actually creates a custom GSAK script every time based on what it sees needs to be done.  It uses WinZip command line tool to unzip the new file.  It automatically renames the files so I can tell what they are on my iPaq and ONLY imports the file the first time (saving processing time).

 

Thanks for sharing, caderoux, and for bringing the thread back on topic - your script is obviously more advanced and is helpful for generating new ideas and figuring out how to implement them!

Link to comment

I hadn’t created a batch file since the days of MSDOS (I know, I’m dating myself) and decided to start this thread to share what I learned with others interested in automating GSAK for the first time, and to encourage those with more experience to share their GSAK automation tips.

 

Thank you for sharing your procedure. I am about 95% clear on what to do from your writeup (which I think was done very well) and will try it tomorrow. ;) I have been on a Macintosh for too many years and have not coded any batch jobs on Windows (therefore the 95% statement). :lol:

 

If I get it working it will be fantastic ;) as I too download a GPX file from GC.com, GSAK it to a MapSource file (so I can USB it to my 60cs), a Palm Cachemate file for hotsync, and create a file for SA 2004, as I like to look at a map and make a mental plan of where I am headed. These are all the steps I do manually. :lol:

 

If I get stuck, I will be sending for help, if that is OK? ;)

 

Just this weekend I stumbled on to the ARC filter feature, :lol: and got it working, for our trips, and now this. How much better can it get? :lol: With Clyde at the helm we know it will. ;)

Link to comment

What the geocaching world needs is a program - maybe even on that runs right on your Mac- that would let you take a GPX file and make it into a Mapsoruce file, a SA file, your other favorite mapping programs, and maybe even directly to your receiver. Yeah, one with no pointy clicky stuff to get in the way that could be automated and used by other programs. That would rule!

 

(OK, add cachemate in there and we need two programs...)

Link to comment

I've just got to say that I'm having a blast with this automating thing..!! I'm no programmer whatsoever but, I like to "tinker" with this sort of thing...

 

First off, here are the things I wish to do...

  • Get a PQ for my zip code 53089 No problems here
  • Export to HTML Problem here is I have to create a "new.gpx" in order to change the codes so my HTML,Plucker,S&T,Mapsource,etc. all match..
  • Export to Streets and TripsNo problems here
     
  • Export to MapsourceNo problems here..Really no problem once USB support for the 60cs is working..

All of the above is really no problem... Now, I'm wondering if there's a way I can make the "script" automatically delete the "new.gpx" file..

 

Here's a copy of my .txt file..

 

# Load latest pocket query for 53089 zip code

LOAD file="C:\Documents and Settings\Bill\Desktop\14737.gpx" Database="default"

# Export New GPX

Export Type=GPX File="C:\Documents and Settings\Bill\Desktop\new.gpx"

# Load New GPX

LOAD file="C:\Documents and Settings\Bill\Desktop\new.gpx" Database="53089"

# Export to MapSource

Export Type=MPS File="C:\Documents and Settings\Bill\Desktop\Geocaching\Geo

 

Files\53089\53089.mps"

# Export to Streets and Trips

Export Type=SNT File="C:\Documents and Settings\Bill\Desktop\Geocaching\Geo

 

Files\53089\53089.csv"

# Prompt to connect GPSr, then export to GPSr

#PAUSE Msg="Connect the GPSr and turn it on before clicking 'OK'"

#Export Type=GPS

# Export to HTML and remind me to HotSync.

Export Type=HTML File="C:\Documents and Settings\Bill\Desktop\Geocaching\Geo Files\53089\"

PAUSE Msg="Remember to Plucker and HotSync the Palm!"

EXIT

 

Like I said, I'm no programmer but maybe you can help?... Can I cut corners here somewhere?

 

Thanks Clyde! This is fun!! A great tool too!!

Edited by Team Flushingrouse
Link to comment

I use automation in a batch file to import my pocket queries and then delete the zip file. Occasionally I forget to close GSAK before doing that which means the pq is not imported (gsak error) but deleted. :blink:

 

Would it be possible to

 

- use DDE or something like that to import the pq into the currently runing instance

- shut down any open instance of GSAK prior to use automated import

or

- return an ERRORLEVEL <> 0 for failed imports so I can test for that in my batch file and not delete the PQ

 

Cheers

Roolku

Link to comment

If you are using a batch file to call your .txt file you can put the following line at the end of it to delete your 'new.gpx' file:

 

del "C:\Documents and Settings\Bill\Desktop\new.gpx"

 

Here is my batch file that calls GSAK.txt:

"c:\program files\gsak\gsak" /run "d:\geocaching\GSAK.txt"

copy d:\geocaching\gpx\*.gpx Y:\virtual\my.web.server\gpx\*.gpx

del d:\geocaching\gpx\*.gpx

Normally I comment out my del command because ussing the local copies is faster than using the ones on the web server.

 

Here is my GSAK.txt file:

LOAD File="v:\geocaching\110731.zip" Database="Member Only"

EXPORT Type=HTML File="Y:\virtual\my.web.server\Caches\Member"

EXPORT Type=GPX File="d:\geocaching\gpx\member.gpx"

EXPORT Type=CMT File="d:\geocaching\topalm\member.pdb"

LOAD File="v:\geocaching\108989.zip" Database="combined"

FILTER Name="active"

EXPORT Type=GPX File="d:\geocaching\gpx\combined.gpx"

#EXPORT Type=CMT File="d:\geocaching\topalm\cmcombined.pdb"

FILTER Name="Found"

EXPORT Type=HTML File="Y:\virtual\my.web.server\Caches\Found"

EXPORT Type=GPX File="d:\geocaching\gpx\found.gpx"

EXPORT Type=CMT File="d:\geocaching\topalm\found.pdb"

FILTER Name="archived"

EXPORT Type=HTML File="Y:\virtual\my.web.server\Caches\Archived"

EXPORT Type=GPX File="d:\geocaching\gpx\archived.gpx"

EXPORT Type=CMT File="d:\geocaching\topalm\archived.pdb"

FILTER Name="H0-20"

EXPORT Type=HTML File="Y:\virtual\my.web.server\Caches\Distance\0-20"

EXPORT Type=GPX File="d:\geocaching\gpx\H0-20.gpx"

EXPORT Type=CMT File="d:\geocaching\topalm\H0-20.pdb"

FILTER Name="H20-50"

EXPORT Type=HTML File="Y:\virtual\my.web.server\Caches\Distance\20-50"

EXPORT Type=GPX File="d:\geocaching\gpx\H20-50.gpx"

EXPORT Type=CMT File="d:\geocaching\topalm\H20-50.pdb"

FILTER Name="H50-100"

EXPORT Type=HTML File="Y:\virtual\my.web.server\Caches\Distance\50-100"

EXPORT Type=GPX File="d:\geocaching\gpx\H50-100.gpx"

EXPORT Type=CMT File="d:\geocaching\topalm\H50-100.pdb"

FILTER Name="H100-150"

EXPORT Type=HTML File="Y:\virtual\my.web.server\Caches\Distance\100-150"

EXPORT Type=GPX File="d:\geocaching\gpx\H100-150.gpx"

EXPORT Type=CMT File="d:\geocaching\topalm\H100-150.pdb"

FILTER Name="H150-200"

EXPORT Type=HTML File="Y:\virtual\my.web.server\Caches\Distance\150-200"

EXPORT Type=GPX File="d:\geocaching\gpx\H150-200.gpx"

EXPORT Type=CMT File="d:\geocaching\topalm\H150-200.pdb"

FILTER Name="H200-250"

EXPORT Type=HTML File="Y:\virtual\my.web.server\Caches\Distance\200-250"

EXPORT Type=GPX File="d:\geocaching\gpx\H200-250.gpx"

EXPORT Type=CMT File="d:\geocaching\topalm\H200-250.pdb"

FILTER Name="H250-300"

EXPORT Type=HTML File="Y:\virtual\my.web.server\Caches\Distance\250-300"

EXPORT Type=GPX File="d:\geocaching\gpx\H250-300.gpx"

EXPORT Type=CMT File="d:\geocaching\topalm\H250-300.pdb"

#FILTER Name="H300+"

#EXPORT Type=GPX File="d:\geocaching\gpx\H300+.gpx"

#EXPORT Type=HTML File="Y:\virtual\my.web.server\Caches\Distance\300+"

#EXPORT Type=CMT File="d:\geocaching\topalm\H300+.pdb"

EXIT

 

I copy the .gpx files to my web server so that I can have access to them from my PC at work for use with GSAK.

 

One thing I have found is that you do not need to unzip the PQ's you get from gc.com, GSAK will automatically unzip them for you.

Edited by Team yGEOh
Link to comment
If you are using a batch file to call your .txt file you can put the following line at the end of it to delete your 'new.gpx' file:

 

del "C:\Documents and Settings\Bill\Desktop\new.gpx"

 

I don't know what I'm doing wrong in regards to this... I added the line both Before and After the EXIT at the end and it still leaves the "new.gpx" on my desktop... Some more digging I suppose...

 

It's not too difficult to drag the file over to the trash either but, I just thought.....

 

Thanks for your help!!

 

~Bill :blink:

Link to comment
What the geocaching world needs is a program - maybe even on that runs right on your Mac-  that would let you take a GPX file  and make it into a Mapsoruce file, a SA file, your other favorite mapping programs, and maybe even directly to your receiver.  Yeah, one with no pointy clicky stuff to get in the way that could be automated and used by other programs.  That would rule!

 

(OK, add cachemate in there and we need two programs...)

My comment about being a Mac person since the beginning meant I WAS a Mac person until last year when I got in to the automation and paperless arena of geocaching. :) Before going paperless the Mac was fine, log on to the internet, print the cache pages and head out, oh yea, somewhere along the line, enter the waypoints BY HAND into the GPS'r. And they call that the good old days! :D While I was doing the paper thing, you guys were automating the whole process. Once hooked on geocaching I discovered automation and I got tired of trying to make it work on a Mac, and, never quite having all the pieces. :D Next I bought a PC :blink: and went paperless by using a Palm and automated the waypoint loading process. :D

 

Of course until TODAY it was a multi-step process. :) Now thanks to the graceous sharing of information by the Kai Team, and a little help from the post by Team Flushingrouse, and of course with the programs written by you :D and ClydeE :D this is a ONE STEP COMPLETELY AUTOMATED PROCESS. :D:):)

 

Yep, today I was able to create the batch program, the text program, and even the desktop short cut. It all worked, well not at first, but I fixed one little location problem and it is working just fine. What a feeling of accomplishment to automate it all. I still load the 60cs with MapSource because of the USB support and hope to see GSAK (GPSBabel) USB support soon. Yes, I dropped a $20 into the support fund today at http://gpsbabel.sourceforge.net/ to help speed along the effort. I had tried last week but it wasn't working at that time. Thanks again to everyone.

Link to comment
If you are using a batch file to call your .txt file you can put the following line at the end of it to delete your 'new.gpx' file:

 

del "C:\Documents and Settings\Bill\Desktop\new.gpx"

 

I don't know what I'm doing wrong in regards to this... I added the line both Before and After the EXIT at the end and it still leaves the "new.gpx" on my desktop... Some more digging I suppose...

 

The del command should come before the EXIT command (anything after EXIT is ignored).

 

Make sure you're typing the full path and file name exactly - if you're off by one character (even a space), the file won't be found and therefore won't be deleted.

 

I find that the best thing (given long paths in Windows these days) is to copy and paste the path directly from Windows Explorer. Press the Windows Key and "E" to open Windows Explorer, then click on "Tools", "Folder Options", "View" and check the box next to "Display the full path in the address bar". Click "Apply" and "OK".

 

Use Windows Explorer to navigate to your "new.gpx" file, highlight the entire path shown in the Windows Explorer address bar, copy (right click - copy) and then paste (Edit - paste) the path into your batch file. You still have to type the \filename (e.g. \new.gpx) at the end, but the odds of a typo are greatly reduced!

 

Edited for a typo - doesn't it figure!

Edited by Kai Team
Link to comment
I use automation in a batch file to import my pocket queries and then delete the zip file. Occasionally I forget to close GSAK before doing that which means the pq is not imported (gsak error) but deleted. B)

 

Would it be possible to

 

- use DDE or something like that to import the pq into the currently runing instance

- shut down any open instance of GSAK prior to use automated import

or

- return an ERRORLEVEL <> 0 for failed imports so I can test for that in my batch file and not delete the PQ

 

Cheers

Roolku

I don’t want to go into too much detail, as users often get disappointed when new features are mentioned but don’t show up for a while.

 

However (sorry if a bit off topic, but i think this is relevant), let me explain what I envisage happening with regard to automation.

 

Firstly, I will be adding the “run” command (just like the windows Start=>run) to GSAK. This will allow you to run any external program or batch file from the automation script. This way you can put everything in the script (like the deletion of GPX file), so if the script doesn’t finish for some reason, your files will not be deleted.

 

Secondly, I plan to allow for scripts to execute while GSAK is already running (Though you will still be able to run from the command line). This means that Automation would get its own main menu option complete with sub options for creating, running, saving, scripts. This would allow you to set up scripts to run common tasks within GSAK.

 

This won’t happen overnight, but it will happen. Hopefully you can see the potential here.

Link to comment
If you are using a batch file to call your .txt file you can put the following line at the end of it to delete your 'new.gpx' file:

 

del "C:\Documents and Settings\Bill\Desktop\new.gpx"

 

I don't know what I'm doing wrong in regards to this... I added the line both Before and After the EXIT at the end and it still leaves the "new.gpx" on my desktop... Some more digging I suppose...

 

It's not too difficult to drag the file over to the trash either but, I just thought.....

 

Thanks for your help!!

 

~Bill B)

the "del" command is not a valid GSAK automation command so it won't matter if you put it before or after exit. Currently if you want to delete files you will have to do this outside of the automation script (like in the batch file calling the automation script)

 

Indirect support for the del command will come when I add the "run" command to automation - see my previous post.

Link to comment
the "del" command is not a valid GSAK automation command so it won't matter if you put it before or after exit. Currently if you want to delete files you will have to do this outside of the automation script (like in the batch file calling the automation script)

 

Indirect support for the del command will come when I add the "run" command to automation - see my previous post.

Good point Clyde - both Team yGEOh and I were assuming that Team Flushingrouse was trying to use the delete (del) command in the batch file, not the GSAK commands (automation) file. Team yGEOh said that in his reply, but it should be emphasized - the "del" command will only work from the batch file, not from the GSAK automation file (i.e. put the "del" command in the batch file after the GSAK run command and before the EXIT command)!

 

Also, as noted, if you do use the delete command in your batch file, be careful that you've closed GSAK before running GSAK automatically (i.e. running the batch file), since GSAK automation will not (currently) work if GSAK is already running, but the delete command will still delete your gpx file!!

 

Edited to correct references.

Edited by Kai Team
Link to comment

B)

 

Good point Clyde - both Team yGEOh and I were assuming that Team Flushingrouse was trying to use the delete (del) command in the batch file, not the GSAK commands (automation) file. Team yGEOh said that in his reply, but it should be emphasized - the "del" command will only work from the batch file, not from the GSAK automation file (i.e. put the "del" command in the batch file after the GSAK run command and before the EXIT command)!

 

You guys are the best!! Yup, I had the "del" command in the wrong file!! After moving it to the .bat file, all is well. I had to add a couple of quotes and stuff like that but, it's going away all by itself now!

 

Thanks to all for the help!

You should see me now---giving myself high-fives!! Wife and kids think I'm going nuts!! Not too bad for some dumb old carpenter...:)

Edited by Team Flushingrouse
Link to comment

This is the batch file that I use on one of 3 computers....

the computername bit detects which machine i am on and therefore sets the directory where my gpx's are stored. I also use 7-zip to unzip (which is free and therefore ok to use - unlike winzip which costs $30)

It also copies files to my thumbdrive (j:) so you may want to delete this too. I keep the gpx files so that when I synch them to the pda they are available to open - one huge export from gsak would take too long to open in gpxsonar.

 

@echo off

if {%computername%}=={HELSBYPC} set dirs=\\bangkok\userdocs\andrew.helsby\helsby_dell_X5 My Documents\gpx files

if {%computername%}=={NB_MAKEHAM} set dirs=\\bangkok\userdocs\andrew.helsby\helsby_dell_X5 My Documents\gpx files

if {%computername%}=={OEMPC001} set dirs=D:\My Documents\helsby_dell_X5 My Documents\gpx files

pushd "%dirs%"

cd

del gsakcommands.txt >nul

call :movefiles 42168 found-42168

call :movefiles 39489 home-39489

call :movefiles 42567 bury-42567

call :movefiles 39985 bicester-39985

call :movefiles 49858 birmingham-49858

call :movefiles 49860 rew-49860

call :movefiles 50866 lloyds-50866

call :movefiles 51557 locationless-51557

call :movefiles 51576 alllocationless-51576

call :movefiles 52966 hayonwye-52966

call :movefiles 54235 chester-54235

call :movefiles 54805 matlock-54805

call :movefiles 55768 edale-55768

call :movefiles 83224 brighouse-83224

call :movefiles 60680 Manchester-60680

call :movefiles 61021 Chesterfield-61021

call :movefiles 63094 easychesterfield-63094

call :movefiles 63514 wesley-63514

call :movefiles 64354 nwmeet-64354

call :movefiles 70450 burton-70450

call :movefiles 79470 morpeth-79470

call :movefiles 80482 horncastle-80482

call :movefiles 107474 full09-107474

call :movefiles 83275 full08-83275

call :movefiles 83263 full01-83261

call :movefiles 83265 full02-83265

call :movefiles 83266 full03-83266

call :movefiles 83267 full04-83267

call :movefiles 83269 full05-83269

call :movefiles 83543 palterton-83543

call :movefiles 88555 radyne-88555

 

popd

echo EXIT >>gsakcommands.txt

c:\progra~1\gsak\gsak /run "%dirs%\gsakcommands.txt"

goto :eof

 

:movefiles

::%1=filenamefromgeocaching

::%2=descriptivename

if not exist %1.zip goto noneedtounzip

c:\progra~1\7-zip\7z e %1.zip -y

if errorlevel 1 echo There was a problem unzipping & pause

del %1.zip

:noneedtounzip

if not exist %1.gpx goto :eof

%pause%

del ..\..\oldgpxfiles\%2.old.gpx >nul

move %2.gpx ..\..\oldgpxfiles\%2.old.gpx

move %1.gpx %2.gpx

echo %1 moved to %2.gpx

copy %2.gpx j:\%2.gpx /y

echo LOAD File="%dirs%\%2.gpx" >>gsakcommands.txt

goto :eof

Link to comment

For anybody else wanting to automate GSAK it is easier than one would think, I should know, I copied most of the data from this forum, here is my batch file:

 

CD \Program Files\GSAK\

gsak /run "C:\Documents and Settings\wornout\my

documents\Geocaching\GSAK_Commands.txt"

EXIT

 

And here is my actual text file:

 

LOAD LATEST GPX PQ'S

#

Load file="C:\Documents and Settings\wornout\My Documents\Geocaching\GPX Downloads\Current\62618.gpx" Database="current"

#

#FILTER OUT PEACE POINT AND INACTIVE CACHES

#

FILTER Name="Archived"

#

#EXPORT TO STREET ATLAS 2004

#

Export Type=TXT File="C:\DeLorme Docs\Draw\current.txt"

#

#EXPORT TO MAPSOURCE

#

Export Type=MPS File="C:\Garmin\Current.mps"

#

#PROMPT TO CONNECT GPS'r, THEN EXPORT TO GPS'r

#

PAUSE Msg="Connect the GPSr and turn it on before clicking 'OK'"

Export Type=GPS

#

#EXPORT TO CACHEMATE AND REMIND ME TO HOTSYNC

Export Type=CMT File="C:\Program Files\Palm\ADD-ON\current.pdb"

PAUSE Msg="Remember to HotSync the Palm Pilot!"

EXIT

 

When this file is executed by the batch file, it takes my current saved GPX downloaded file, filters it with a filter I set up earlier in GSAK, then it exports a txt file to DeLorme Street Atlas 2004, then it exports an mps file to MapSource (this is not really needed now that GSAK can export via USB port) then it puts out a message to remind me to turn on my GPSr, then it sends the file via USB to the 60cs, then it exports a file for cachemate to my palm staging area and reminds me to hit the hot sync button.

 

This is all at the touch of a button.

Link to comment

For those of you with a Palm that has an expansion card, you can save a great deal of time by using a card reader and exporting directly to your card. The Cachemate .pdb file goes in the \Cachemate directory. If you have a printer that has card slots, that works as a card reader, although slower than a real card reader; it's still a *lot* faster than hotsyncing. Just use whatever drive letter Windows assigns to the reader or printer, and forget about hotsyncing. If you don't have an SD card or slot, you have my condolences.

Link to comment
If you don't have an SD card or slot, you have my condolences.

:lol: I have the SD card, but alas no card reader (I'm going to have to get one that reads CF as well, for my digital camera!).

 

Thanks for the tip!

Card readers are available everywhere. Get yourself a multi-reader (7in1) to cater for a multitude of uses. They're only about 20bucks, a great investment

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...
×
×
  • Create New...