+Weihnachtsmann Posted December 13, 2005 Posted December 13, 2005 How can I change the GSAK's GoogleEarth.txt-Macro to see not all the caches filtered by GSAK but only the cache highlighted by the cursor in GSAK? Quote
+Pasha Posted December 13, 2005 Posted December 13, 2005 (edited) I assume you're using the one from the GSAK macros page or released with recent GSAK versions? I'm not sure how you could only output the currently-selected cache. The below modified version will allow you to only output user-flagged caches, though. If you're not familiar with the term "user flag", see the User Flag section of this helpfile page. # ************************************************* # Macro to show your current filter in Google Earth #************************************************** # set up absolute paths to required files $KMLFile=$_Install + "\temp\GSAK.KML" $GPXFile=$_Install + "\temp\babel.gpx" $Babel = $_Install + "\gpsbabel.exe" # Filter for user flags MFILTER IF=$d_UserFlag # Make sure there's at least one user-flagged record IF $_FilterCount = 0 CANCEL Msg="No records flagged!" ENDIF # set up $custom export $Custom = $custom + "edtBabelOut.Text=" + quote($Babel) + " -N -i gpx -f " + quote($GPXfile) + " -o kml -F " + quote($KMLFile) MACROSET Dialog=Custom VarName=$Custom # Export to KML EXPORT Type=CUS Settings=<macro> # Open the file in Google Earth OpenFile File=$KMLFile # cancel the MFILTER CANCELFILTER <data> VarName=$Custom [TfmBabel2] edtProblem.Text= edtFormat.Text=%name edtMaxGps.Text=100 edtWaypoint.Text=%name %typ %con (%dif/%ter) chkDebug.Checked=False <enddata> Edit: added helpfile link Edited December 13, 2005 by Pasha Quote
+ClydeE Posted December 14, 2005 Posted December 14, 2005 How can I change the GSAK's GoogleEarth.txt-Macro to see not all the caches filtered by GSAK but only the cache highlighted by the cursor in GSAK? Assuming you have the GoogleEarth.txt macro in the Macros folder of the Install folder of GSAK (but it would be easy to alter it to work from any folder) then this macro will do it automatically for you. Then all you have to do is add as a tool button and it is only one mouse click away. $GEMacro=$_Install + "\Macros\GoogleEarth.txt" MacroFlag Type=Clear Range=All MacroFlag Type=Set Range=1 Mfilter if=$d_MacroFlag Macro File=$GEMacro CancelFilter Quote
+Pasha Posted December 14, 2005 Posted December 14, 2005 I didn't even think of using the Macroflag Range=1 thing. Dur. Quote
+papatom2 Posted December 14, 2005 Posted December 14, 2005 Could not this be done simpler with a right click on the waypoint and use the "custom URL"?? Quote
+ClydeE Posted December 14, 2005 Posted December 14, 2005 Could not this be done simpler with a right click on the waypoint and use the "custom URL"?? Not for GE because it is a program and it needs a file passed to it. However, you can do this for the online service provided by Google because all it requires is a URL. You just need to add the following custom URLs Google Maps=http://maps.google.com/maps?q=%lat+%lon+(%code-%ShortName=30)&hl=en Google Satellite View=http://maps.google.com/maps?q=%lat+%lon+(%code-%ShortName=30)&spn=0.020,0.020&t=k Quote
+TFTC Posted December 14, 2005 Posted December 14, 2005 (edited) This is probably not the right place to post this, but since I'm running into the problem while editing the GE macro, here it is! I'm not able to successfully use special tags in the macro (I want to put %last4 in the description bubble). I'm using: $cacheName = $d_Name $placedBy = $d_PlacedBy $diff = $d_Difficulty $terrain = $d_Terrain GetSpecial Data=%last4 $last4 = $result GetSpecial Data=%drop2 $drop2 = $result But I get an error on the $last4 = $result line (Invalid expression in macro). What's the right way to get that data? Thanks! Love the macro, I have it doing great things! Edited December 14, 2005 by ahimsa Quote
+ClydeE Posted December 14, 2005 Posted December 14, 2005 This is probably not the right place to post this, but since I'm running into the problem while editing the GE macro, here it is! I'm not able to successfully use special tags in the macro (I want to put %last4 in the description bubble). I'm using: $cacheName = $d_Name $placedBy = $d_PlacedBy $diff = $d_Difficulty $terrain = $d_Terrain GetSpecial Data=%last4 $last4 = $result GetSpecial Data=%drop2 $drop2 = $result But I get an error on the $last4 = $result line (Invalid expression in macro). What's the right way to get that data? Thanks! Love the macro, I have it doing great things! Bummer, you have actually found a small bug with the GetSpecial command. The problem is that $Result is not being correctly returned as a string in double quotes (it is missing the double quotes). The work around for the moment is to just surround $result with double quotes when you do the assignment: GetSpecial Data=%last4 $last4 = "$result" GetSpecial Data=%drop2 $drop2 = "$result" Quote
+TFTC Posted December 14, 2005 Posted December 14, 2005 The work around for the moment is to just surround $result with double quotes when you do the assignment: GetSpecial Data=%last4 $last4 = "$result" GetSpecial Data=%drop2 $drop2 = "$result" That works great! Thanks!! Wow, this macro is much easier than the way I was doing it before! I've changed it slightly so that the waypoint labels only show up when you mouse over them and added more info to the popup bubble! Quote
Recommended Posts
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.