geo_taz Geplaatst 4 januari 2009 Geplaatst 4 januari 2009 Nog makkelijker wordt het als je niet alleen een Oregon of Colorado hebt, maar ook gebruik maakt van GSAK. Er is niet alleen een macro beschikbaar om Geocaches vanuit GSAK te laden, maar er is er ook een om te loggen. Deze leest het door Smeule genoemde text-file, geeft je de gelegenheid om (in GSAK) de log wat uitgebreider te maken en stuurt dan de hele boel naar geocaching.com.
Track_leader Geplaatst 4 januari 2009 Geplaatst 4 januari 2009 (bewerkt) hoi allemaal, ik heb iets dergelijks geschreven. Ik moet even mijn andere computer morgen starten en kijken of ik de schijf kan benaderen (ernstige problemen op die pc ) het geheel is een combinatie van een aantal macro's de werking is zoals voor de oregon en colorado. op basis van de founds in gsak en de tekst die je hebt ingeklopt wordt er een founds.txt gemaakt die uiteindelijk word geüpload naar gc.com in je field notes sectie inclusief datum enz enz ik zal proberen de macro morgen te plaatsen in dit draadje JK 4 januari 2009 bewerkt door Track_leader
kalkendotters Geplaatst 4 januari 2009 Geplaatst 4 januari 2009 Houdt er wel rekening mee, dat de maximale lengte van logs in de Fieldnotes momenteel beperkt is tot ca 500 tekens. Is je log langer dan wordt dit tijdens het omzetten vanuit de Fieldnote naar de Log genadeloos afgekapt.
Track_leader Geplaatst 5 januari 2009 Geplaatst 5 januari 2009 ik heb het gevonden, het is een bestaande macro en ik heb wat aan gepast, wil je meer weten stuur dan een PB en ik help je verder #******************************************* # MacVersion = 0.19 # MacDescription = 60CSX Log Automation tool # MacAuthor = SnoWake, Lignumaqua enhanced by Track_leader # MacFileName = Autologging60csx.gsk # MacUrl = #******************************************* # # This macro combines the functions to read the geocache_visits.txt file from the Colorado # and update the database with a second routine to step through those entries enabling the user to write the logs # before creating a new txt file ready for uploading to GC.com Field Notes page. # # If all you are doing is Step 2, creating a field notes file, then make sure that only caches to be added to file are in view # and are in the correct logging order. The macro will only create logs and field notes for caches that are both marked 'Found' AND # that currently have no 'Found' log from you. # GC18H5V,2008-02-20T07:53Z,Found it,"" ##################################################################### GOSUB name=DeclareVariables # Requires at least this build or later for UTF16() function and SQLite VERCHECK Version=7.2.4.10 (Note: this macro requires the latest 7.2.4 GSAK patch release - see http://gsak.net/board/index.php?showtopic=9520 for the download link) ############################################################ # PreLoad User variables into Form ############################################################ $MatchDatabase = "NotFound" # "Default" (home) Time zone $TimeZoneOffset=-8 $TimeZoneString = NumToStr($TimeZoneOffset) $UserFlagCheckbox=TRUE $UserSortCheckbox=TRUE $TimeButton=FALSE $DateButton=FALSE $DateTimeButton=TRUE $NoneButton=FALSE $UserLogButton=TRUE $UserNotesButton=FALSE $AddButton=TRUE $ReplaceButton=FALSE $FixedTextBox=FALSE #set database dropdown values $Databases=Sysinfo("Databases") $DatabasesNone="*None*" + ";" + $Databases ############################################################# # Settings file $datafilepath = Sysinfo("MacroPath") $DataFile = $datafilepath + "\autologgin60csx.dat" $Filepath = $datafilepath IF (FileExists($DataFile)) # First, slurp the contents of the file $variables = GetFile($DataFile) # Now, extract out the individual values $TimeZoneString = Extract($variables,";",1) $InputFile = Extract($variables,";",2) $MatchDatabase = Extract($variables,";",3) $UserFlagCheckbox = StrToBool(Extract($variables,";",4)) $UserSortCheckbox = StrToBool(Extract($variables,";",5)) $TimeButton=StrToBool(Extract($variables,";",6)) $DateButton=StrToBool(Extract($variables,";",7)) $DateTimeButton=StrToBool(Extract($variables,";",8)) $NoneButton=StrToBool(Extract($variables,";",9)) $UserLogButton=StrToBool(Extract($variables,";",10)) $UserNotesButton=StrToBool(Extract($variables,";",11)) $ReplaceButton=StrToBool(Extract($variables,";",12)) $AddButton=StrToBool(Extract($variables,";",13)) $Filepath = Extract($variables,";",14) $FoundDatabase = Extract($variables,";",15) $CutOffDate = Extract($variables,";",16) $Ignore = StrToBool(Extract($variables,";",17)) $ArchiveFile = StrToBool(Extract($variables,";",18)) $DeleteFile = StrToBool(Extract($variables,";",19)) IF Extract($variables,";",21) = "" $FixedTextBox = FALSE ELSE $FixedTextBox = StrToBool(Extract($variables,";",21)) ENDIF ENDIF #Determin the total number of founds in the Founda database # Save current database $currentdb = $_CurrentDatabase # Change database if necessary IF $_CurrentDatabase <> $FoundDatabase DATABASE Name="$FoundDatabase" Action=Select ENDIF MFILTER Expression=$d_Found $CurrentFounds = $_FilterCount $C_total = $CurrentFounds DATABASE Name="$_CurrentDatabase" Action=Select ## Endpicking up current found status IF RegExCount(";",$variables) < 16 # Default cut off date (date of first ever cache) $CutOffDate = "2000-05-03T00:00Z" $Ignore = TRUE $ArchiveFile = FALSE $DeleteFile = FALSE ENDIF # Make sure at least one of the radio buttons is selected in each set IF NOT($TimeButton OR $DateButton OR $DateTimeButton OR $NoneButton) $DateTimeButton=TRUE ENDIF IF NOT($UserLogButton OR $UserNotesButton) $UserNotesButton=TRUE ENDIF IF NOT($ReplaceButton OR $AddButton) $AddButton=TRUE ENDIF #GOSUB Name=AutoDetect # Don't need to auto detetct the GARMIN DEVICE IF $Drive = "" IF $InputFile = "" $Inputfile = "G:\garmin\geocache_visits.txt" ENDIF ELSE $Inputfile = $Drive + ":\garmin\geocache_visits.txt" ENDIF $DateTime = $CutOffDate GOSUB name=ConvertDate $Form = EditForm($Form,"Ignorelabel","Caption","Ignore logs before " + $NotesString) ############################################################ # Form to Collect / Adjust User Input ############################################################ WHILE TRUE $result = Form($form,"") # Reset the screen position of the menu form to where the user left it $Form = EditForm($Form,"Autologging60csx","Top",$_FormTop) $Form = EditForm($Form,"Autologging60csx","Left",$_FormLeft) BEGINCASE #Buttons CASE $Cancel CANCEL CASE $OK # Clean up the time and make sure it's a number $TimeZoneOffset = Val($TimeZoneString) $TimeZoneString = NumToStr($TimeZoneOffset) $FlagCaches = TRUE GOSUB name=LoadAndParseFile CASE $Create GOSUB name=SaveDataFile GOSUB name=CreateLogFile GOSUB name=AnyOver500 CASE $GPX GOSUB name=GetGpx CANCEL CASE $FixedTextButton GOSUB name=EditFixedText CASE $settings GOSUB name=SaveDataFile OTHERWISE CANCEL ENDCASE ENDWHILE # Form Loop BEGINSUB name=LoadAndParseFile # Save current database $currentdb = $_CurrentDatabase # Change database if necessary IF $_CurrentDatabase <> $MatchDatabase DATABASE Name="$MatchDatabase" Action=Select ENDIF # Read File IF FileExists($Inputfile) $data = GetFile($Inputfile) ELSE Pause Msg="Cannot find Colorado input file" CANCEL CANCEL ENDIF $data = UTF16($data,"d") $DataWritten = FALSE # How many lines are there? $CountLines = RegexCount("\n",$data) #Check for separator $Separator = mislukt!10) # Set up a loop and read through the file, one line at a time and populate the SQL table $i = 1 $_sql = "BEGIN" $status = Sqlite("sql",$_sql) WHILE $i<=$CountLines $line = Extract($data, $Separator, $i) $line = Replace(mislukt!13),"",$line,TRUE) # Extract the four data elements from the line # including the final "text" field which will contain field notes (currently empty quotes) $Code=Extract($line, ",", 1) $Status=Extract($line, ",", 3) $DateTime=Extract($line, ",", 2) $Log = RegExSub("\x22(.*?)\x22$",$line,1,1) #$Log = Replace($_Quote,"'",$Log,TRUE) # Escape any single quotes $Log = Replace("'","''",$Log,TRUE) $Status = Replace("'","''",$Status,TRUE) $Code= Replace("'","''",$Code,TRUE) # Check date is after the cut off IF $DateTime > $CutOffDate OR $ignore = FALSE $DataWritten = TRUE $_sql = "INSERT INTO ColoradoImport VALUES('$Code','$Status','$DateTime','$Log')" $status = Sqlite("sql",$_sql) ENDIF $i = $i + 1 ENDWHILE $_sql = "END" $status = Sqlite("sql",$_sql) # Last entry is our new $CutOffDate $CutOffDate = $DateTime GOSUB name=SaveDataFile # Get an unduplicated list of cache codes $_sql = "Select count(code) as c, code from coloradoimport group by code order by c desc" $work = Sqlite("sql",$_sql) #$work = sql($sql,"") $list = list("sql","replace",$work) $countlines = Val(List("sql","count","")) #Set up the output message string $msg = "Actions Performed" + $_NewLine + $_NewLine $i = 1 $k = 0 # Iterate through the cache codes WHILE $i<=$CountLines AND $DataWritten $list = List("sql","item","$i") $Entries = Val(Extract($list,";",1)) $Code = Extract($list,";",2) $_sql = "Select status, datetime, log from coloradoimport WHERE code='$Code' ORDER BY datetime" $work = Sqlite("sql",$_sql) #$work = sql($sql,"") $list2 = list("sql2","replace",$work) $OutputStatus = "Unattempted" $OutputDateTime = "" $OutputLog = "" $Maintenance = FALSE $j = 1 # For each cache code iterate through the entries and just use the last one # Exception is Needs maintenance which can come at any time and still be valid WHILE $j<=$Entries $list2 = List("sql2","item","$j") $status = Extract($list2,";",1) $datetime = Extract($list2,";",2) $log = Extract($list2,";",3) IF $Status = "Needs Maintenance" $Maintenance = TRUE ELSE $OutputStatus = $Status $OutputDateTime = $DateTime $OutputLog = $Log ENDIF $j = $j + 1 ENDWHILE IF $OutputDateTime <> "" $DateTime = $OutputDateTime GOSUB name=ConvertDate ENDIF IF Seek($Code) BEGINCASE CASE $OutputStatus = "Found it" $d_Found = TRUE $d_FoundByMeDate = $LogDate $k = $k + 1 $Msg = $msg + "$k: $Code - Found" + $_NewLine $Text = "Found: " GOSUB name=GlobalUpdate CASE $OutputStatus = "Didn't find it" $d_DNF = TRUE $d_DNFDate = $LogDate $Msg = $msg + "**: $Code - DNF" + $_NewLine $Text = "DNF: " GOSUB name=GlobalUpdate CASE $OutputStatus = "Unattempted" # Should be nothing here ENDCASE IF $Maintenance $NoteText = extract($d_UserNote,"$~",1) $LogText = extract($d_UserNote,"$~",2) $Msg = $msg + "**: $Code - Needs Maintenance" + $_NewLine $Text = "Noted: " $OutputLog = "Needs Maintenance" GOSUB name=GlobalUpdate ENDIF ELSE MSGOK msg="Error: Attempted to log $Code as '$OutputStatus' - cache not found in database" ENDIF $i = $i + 1 ENDWHILE # If flagging matched caches, then stay on $MatchDatabase, filter on flagged, and sort by USort. IF $UserFlagCheckbox MFILTER Expression=$d_UserFlag IF $UserSortCheckbox SORT by="usersort" ENDIF ELSE # return to previous database IF $_CurrentDatabase <> $currentdb DATABASE Name="$currentdb" Action=Select ENDIF ENDIF IF NOT($DataWritten) $msg="No valid caches in geocache_visit.txt file" ENDIF $memoupdated=$msg $result = Form($form4,"") IF $ArchiveFile $OutputFile = $filepath + "\Geocache_visits_" + DateToString($_Today) + Remove(Time(),":","C") + ".txt" FILECOPY From=$InputFile To=$OutputFile ENDIF IF $DeleteFile $result = Form($form5,"") IF $OKDelete FILEERASE File=$InputFile ENDIF ENDIF $Form = EditForm($Form,"OK","Enabled","No") ENDSUB ### End of MACRO BEGINSUB name=SaveDataFile $variables = "$TimeZoneString;$InputFile;$MatchDatabase;$UserFlagCheckbox;$UserSortCheckbox;$TimeButton;$DateButton;$DateTimeButton;$NoneButton;$UserLogButton;$UserNotesButton;$ReplaceButton;$AddButton;$Filepath;$FoundDatabase;$CutOffDate;$Ignore;$ArchiveFile;$DeleteFile;$FixedTextBox;$CurrentFounds" $result = PutFile($datafile, $variables) IF Left($result, 7) = "*Error*" # If theres any error abort the macro CANCEL Msg="Unable to write to $datafile!" ENDIF ENDSUB ### BEGINSUB name=GlobalUpdate IF $UserSortCheckbox $d_UserSort = $DateNum ENDIF IF $UserFlagCheckbox $d_UserFlag = TRUE ENDIF BEGINCASE CASE $TimeButton $OutputLog = $HourString + ":" + $MinuteString + " " + $Text + $OutputLog CASE $DateButton $OutputLog = DateFormat($LogDate) + " " + $Text + $OutputLog CASE $DateTimeButton $OutputLog = $NotesString + " " + $Text + $OutputLog CASE $NoneButton $OutputLog = $Text + $OutputLog ENDCASE $NoteText = extract($d_UserNote,"$~",1) $LogText = extract($d_UserNote,"$~",2) IF Len($NoteText) > 0 AND $UserNotesButton $NoteText = $NoteText + $_NewLine ENDIF IF Len($LogText) > 0 AND $UserLogButton $LogText = $LogText + $_NewLine ENDIF IF $UserLogButton IF $AddButton $LogText = $LogText + $OutputLog ENDIF IF $ReplaceButton $LogText = $OutputLog ENDIF ENDIF IF $UserNotesButton IF $AddButton $NoteText = $NoteText + $OutputLog ENDIF IF $ReplaceButton $NoteText = $OutputLog ENDIF ENDIF $d_UserNote = $NoteText + "$~" + $LogText $d_MacroSort = DateToString($LogDate) + $HourString + $MinuteString ENDSUB BEGINSUB name=ConvertDate # Call with string in $DateTime $DateStr = Extract($DateTime, "T", 1) $TimeStr=left(Extract($DateTime, "T", 2), 5) $Hours=val(extract($TimeStr,":",1)) $Minutes=val(extract($TimeStr,":",2)) $Hours = $Hours + $TimeZoneOffset $Year = StringToDate(left($DateStr,4) + "0101") $CachingDay=DateDiff($Year,StringToDate(remove($DateStr,"-","C"))) IF $Hours >= 24 $Hours = $Hours - 24 $CachingDay = $CachingDay + 1 ENDIF IF $Hours < 0 $Hours = $Hours + 24 $CachingDay = $CachingDay - 1 ENDIF IF Val(Left($DateStr,4))/4 = Int(Val(Left($DateStr,4))/4) $leap = 366 ELSE $leap = 365 ENDIF IF $CachingDay >$leap $Year = $Year + $leap $CachingDay = $CachingDay - $leap ENDIF IF $CachingDay < 1 $Year = $Year - $leap $CachingDay = $CachingDay + $leap ENDIF $HourString = right("00$Hours",2) $MinuteString = right("00$Minutes",2) $DateString = "$CachingDay" + $HourString + $MinuteString # Results - a number for $d_UserSort and a date for Found or DNF $DateNum = Val($DateString) $LogDate = $CachingDay + $Year $NotesString = DateFormat($LogDate) + " " + $HourString + ":" + $MinuteString #MSGOK msg="$DateNum, $LogDate" ENDSUB #******************************************* BEGINSUB name=CreateLogFile # Change database if necessary IF $_CurrentDatabase <> $MatchDatabase DATABASE Name="$MatchDatabase" Action=Select ENDIF $data = "" # Correction for broken GC.com time zone math #$Hours = 16 + $TimeZoneOffset $Hours = 8 - $TimeZoneOffset $Minutes = 0 $edittime = "$Hours" + ":" + "$Minutes" $fieldnotesfile = $filepath + "\FieldNotes_" + DateToString($_Today) + Remove(Time(),":","C") + ".txt" $OldSplitScreen = Sysinfo("gsakini;TfmOffline;cbxHtmFormat.Text") SPEEDMODE Status=Off SPLITSCREEN Display=On Format=Full display SPEEDMODE Status=On $Count = 0 $skipedit = FALSE # Filter to DNF caches IF $UserFlagCheckbox MFILTER Expression=$d_UserFlag AND $d_DNF ELSE MFILTER Expression=$d_DNF ENDIF IF $_FilterCount > 0 SORT by=MacroSort GOTO position=top WHILE NOT($_EOL) $LogFound = FALSE TABLE Active=Logs Scope=parent WHILE NOT($_EOL) AND NOT($LogFound) IF IsOwner() $lt = left($d_lType,5) IF ($lt="Didn'") $LogFound= TRUE ENDIF ENDIF GOTO Position=Next ENDWHILE TABLE Active=caches IF NOT($LogFound) $Count = $Count + 1 $Minutes = $Minutes + 1 IF $Minutes >= 60 $Minutes = $Minutes - 60 $Hours = $Hours + 1 ENDIF $LogDate = $d_DNFDate $NoteText = Extract($d_UserNote,"$~",1) $LogText = Extract($d_UserNote,"$~",2) $Text = "Didn't find it" IF NOT($skipedit) SPEEDMODE Status=Off IF $FixedTextBox $Logtext = $FixedText + $LogText ENDIF GOSUB name=EditLog SPEEDMODE Status=On ENDIF $LogText = Replace($_Quote,"'",$LogText,TRUE) GOSUB name=CreateDate $line = $d_Code + "," + $DateTime + "," + $Text + "," + Quote($LogText) + $_NewLine $data = $data + $line ENDIF GOTO position=next ENDWHILE ENDIF # Filter to found caches IF $UserFlagCheckbox MFILTER Expression=$d_UserFlag AND $d_Found ELSE MFILTER Expression=$d_Found ENDIF IF $_FilterCount > 0 SORT by=MacroSort GOTO position=top WHILE NOT($_EOL) $LogFound = FALSE TABLE Active=Logs Scope=parent WHILE NOT($_EOL) AND NOT($LogFound) IF IsOwner() $lt = left($d_lType,5) IF ($lt="Found" OR $lt="Atten" OR $lt="Webca") $LogFound= TRUE ENDIF ENDIF GOTO Position=Next ENDWHILE TABLE Active=caches IF NOT($LogFound) $Count = $Count + 1 $Minutes = $Minutes + 1 IF $Minutes >= 60 $Minutes = $Minutes - 60 $Hours = $Hours + 1 ENDIF $LogDate = $d_FoundByMeDate $NoteText = Extract($d_UserNote,"$~",1) $LogText = Extract($d_UserNote,"$~",2) $Text = "Found it" IF $d_CacheType = "E" OR $d_CacheType = "Z" OR $d_CacheType = "C" $Text = "Attended" ENDIF IF $d_CacheType = "W" $Text = "Webcam Photo Taken" ENDIF IF NOT($skipedit) SPEEDMODE Status=Off IF $FixedTextBox $Logtext = $FixedText + $LogText ENDIF GOSUB name=EditLog SPEEDMODE Status=On ENDIF IF Len($LogText) > 500 $_sql = "REPLACE INTO LogSize VALUES('$d_Code','TRUE')" ELSE $_sql = "REPLACE INTO LogSize VALUES('$d_Code','FALSE')" ENDIF $status = Sqlite("sql",$_sql) $LogText = Replace($_Quote,"'",$LogText,TRUE) GOSUB name=CreateDate $line = $d_Code + "," + $DateTime + "," + $Text + "," + Quote($LogText) + $_NewLine $data = $data + $line ENDIF GOTO position=next ENDWHILE ENDIF SPEEDMODE Status=ON SPLITSCREEN Display=On Format=$OldSplitScreen CANCELFILTER $data = UTF16($data,"e") IF $count >0 $result = PutFile($fieldnotesfile, $data) IF Left($result, 7) = "*Error*" # If theres any error abort the macro CANCEL Msg="Unable to write to $fieldnotesfile!" ELSE CLIP Data=$fieldnotesfile WEB URL="http://www.geocaching.com/my/uploadfieldnotes.aspx" MSGOK msg="File $fieldnotesfile created. $_newline $_newline Clipboard contains file address ready for pasting on GC.com. $_newline $_newline Click OK here after loading the file on GC.com" ENDIF ELSE CANCEL Msg="No Found caches without Found logs in this database." ENDIF # return to previous database IF $_CurrentDatabase <> $currentdb DATABASE Name="$currentdb" Action=Select ENDIF ENDSUB # name=CreateLogFile BEGINSUB name=CreateDate # Enter with $LogDate, $Hours and $Minutes # Exit with $DateTime # Correction for broken GC.com time zone math #$HoursCorrected = $Hours - $TimeZoneOffset $HoursCorrected = $Hours IF $HoursCorrected >= 24 $HoursCorrected = $HoursCorrected - 24 $LogDate = $Logdate + 1 ENDIF IF $HoursCorrected < 0 $HoursCorrected = $HoursCorrected + 24 $LogDate = $LogDate - 1 ENDIF $HourString = right("00$HoursCorrected",2) $MinuteString = right("00$minutes",2) $DateTime = DateToString($LogDate) $DateTime = Left($DateTime,4) + "-" + SubStr($DateTime,5,2) + "-" + SubStr($DateTime,7,2) $DateTime = $DateTime + "T" + $HourString + ":" + $MinuteString + "Z" ENDSUB #createdate BEGINSUB name=EditLog $Form3 = EditForm($Form3,"CacheName","Caption","Edit '$Text' log for: $d_code: $d_name") $Form3 = EditForm($Form3,"NoteName","Caption","Notes for: $d_code: $d_name") IF $Text = "Didn't find it" $Form3 = Editform($Form3,"CacheName","color","255") ELSE $Form3 = Editform($Form3,"CacheName","color","16744448") ENDIF WHILE TRUE $result = Form($form3,"") # Reset the screen position of the menu form to where the user left it $Form3 = EditForm($Form3,"Form1","Top",$_FormTop) $Form3 = EditForm($Form3,"Form1","Left",$_FormLeft) BEGINCASE #Buttons CASE $Cancel CANCEL CASE $OK #Strip out double quotes $LogText = Replace($_Quote,"'",$LogText,TRUE) $d_UserNote = $NoteText + "$~" + $LogText #$d_UserNote = Extract($d_UserNote,"$~",1) + "$~" + $LogText BREAK CASE $skip $skipedit = TRUE BREAK OTHERWISE CANCEL ENDCASE ENDWHILE # Form Loop ENDSUB BEGINSUB name=EditFixedText $FixedTextOld = $FixedText WHILE TRUE $result = Form($form6,"") # Reset the screen position of the menu form to where the user left it $Form6 = EditForm($Form6,"Form6","Top",$_FormTop) $Form6 = EditForm($Form6,"Form6","Left",$_FormLeft) BEGINCASE #Buttons CASE $FixedCancel $FixedText = $FixedTextOld BREAK CASE $FixedOK #Strip out double quotes $FixedText = Replace($_Quote,"'",$FixedText,TRUE) $result = PutFile($LogTextFile, $FixedText) IF Left($result, 7) = "*Error*" # If theres any error abort the macro CANCEL Msg="Unable to write to $datafile!" ENDIF BREAK OTHERWISE CANCEL ENDCASE ENDWHILE # Form Loop ENDSUB BEGINSUB name=AnyOver500 #DEBUG status=on $_sql = "SELECT Code from LogSize WHERE Over500 = 'TRUE'" $status = Sqlite("sql",$_sql) $Over500List = Replace($_NewLine,";",$status,TRUE) IF Len($over500List) > 0 $Over500caches = Extract($Over500List,";",1) IF Seek($Over500caches) $Over500LogText = Extract($d_UserNote,"$~",2) $Form7 = EditForm($Form7,"Over500Name","Caption","Log for: $d_name") CLIP Data=$Over500LogText ENDIF ENDIF WHILE Len($Over500List) > 0 $result = Form($form7,"") # Reset the screen position of the menu form to where the user left it $Form7 = EditForm($Form7,"Form7","Top",$_FormTop) $Form7 = EditForm($Form7,"Form7","Left",$_FormLeft) BEGINCASE #Buttons CASE $Over500EXIT BREAK CASE $result = "Over500Caches" IF Seek($Over500caches) $Over500LogText = Extract($d_UserNote,"$~",2) $Form7 = EditForm($Form7,"Over500Name","Caption","Log for: $d_name") CLIP Data=$Over500LogText ENDIF OTHERWISE CANCEL ENDCASE ENDWHILE # Form Loop ENDSUB BEGINSUB Name=AutoDetect # Searching for the Colorado # Use the new GPSInfo("GarminPath") function which returns path to GarminDevice.xml $result=GPSInfo("GarminPath") IF FileExists($result) $Drive = Extract($result,":",1) $Model = GPSInfo("GarminModel") $SWversion = GPSInfo("GarminVersion") $SWver = Val($SWversion) / 100 MSGOK msg="Found $Model running software version $SWver on Drive $Drive:\" ELSE MSGOK msg="GPSr not detected - please check connection or enter file path manually" ENDIF ENDSUB BEGINSUB name=GetGpx # Refresh the GPX files and then move all found caches to 'Found' database # Filter to found caches MACROFLAG type=clear range=all MFILTER Expression=$d_Found IF $_FilterCount > 0 SHOWSTATUS msg="Filtering to Found caches with no Found log" Width=350 GOTO position=top WHILE NOT($_EOL) $LogFound = FALSE TABLE Active=Logs Scope=parent WHILE NOT($_EOL) AND NOT($LogFound) IF IsOwner() $lt = left($d_lType,5) IF ($lt="Found" OR $lt="Atten" OR $lt="Webca") $LogFound= TRUE ENDIF ENDIF GOTO Position=Next ENDWHILE TABLE Active=caches IF NOT($LogFound) MACROFLAG type=SET range=1 ENDIF GOTO position=next ENDWHILE SHOWSTATUS msg="Filtering to Found caches with no Found log" Width=350 Display=Off MFILTER Expression=$d_MacroFlag IF $_FilterCount > 0 IF (FileExists($datafilepath + "\RefreshAllGpx.gsk")) MACRO File="RefreshAllGpx.gsk" IF $FoundDatabase <> $MatchDatabase $MoveCopy = Replace("##Found##",$FoundDatabase,$MoveCopy,TRUE) MACROSET Dialog=MOVECOPY Varname=$MoveCopy MOVECOPY Settings=<MACRO> ENDIF ELSE MSGOK msg="You need to have installed the RefreshAll macro to use this option" ENDIF ELSE MSGOK msg="Cannot find any Found caches without a Found log" ENDIF ENDIF ENDSUB <data> VarName=$MoveCopy [TfmMove] cbxDestination.Text=##Found## rbtAdd.Checked=True rbtAddFlag.Checked=False rbtAddIgnore.Checked=False rbtCopy.Checked=False rbtExistIgnore.Checked=False rbtFlagOnly.Checked=False rbtMove.Checked=True rbtReplace.Checked=True rbtReplaceFlag.Checked=False chkDisplay.Checked=True <enddata> BEGINSUB name=DeclareVariables #******************************************************* # Variable declarations for # C:\Program Files\GSAK\Macros\ColoradoImportandLog.gsk # # Generated 8/30/2008 5:53:52 PM on GSAKVariables.gsk Rev V0.20 B15 # #******************************************************* Option Explicit=Yes Declare Var=$AddButton Type=Boolean Declare Var=$ArchiveFile Type=Boolean Declare Var=$BatFile Type=String Declare Var=$CachingDay Type=Numeric Declare Var=$Code Type=String Declare Var=$comspec Type=String Declare Var=$Count Type=Numeric Declare Var=$CountLines Type=Numeric Declare Var=$currentdb Type=String Declare Var=$CutOffDate Type=String Declare Var=$data Type=String Declare Var=$Databases Type=String Declare Var=$DatabasesNone Type=String Declare Var=$DataFile Type=String Declare Var=$datafilepath Type=String Declare Var=$DataWritten Type=Boolean Declare Var=$DateButton Type=Boolean Declare Var=$DateNum Type=Numeric Declare Var=$DateStr Type=String Declare Var=$DateString Type=String Declare Var=$DateTime Type=String Declare Var=$DateTimeButton Type=Boolean Declare Var=$DeleteFile Type=Boolean Declare Var=$DirFile Type=String Declare Var=$dnum Type=Numeric Declare Var=$Drive Type=String Declare Var=$edittime Type=String Declare Var=$Entries Type=Numeric Declare Var=$fieldnotesfile Type=String Declare Var=$file Type=String Declare Var=$Filepath Type=String Declare Var=$FixedText Type=String Declare Var=$FixedTextOld Type=String Declare Var=$FixedTextBox Type=Boolean Declare Var=$FlagCaches Type=Boolean Declare Var=$Form Type=String Declare Var=$Form3 Type=String Declare Var=$form4 Type=String Declare Var=$form5 Type=String Declare Var=$Form6 Type=String Declare Var=$Form7 Type=String Declare Var=$FoundDatabase Type=String Declare Var=$Hours Type=Numeric Declare Var=$HoursCorrected Type=Numeric Declare Var=$HourString Type=String Declare Var=$i Type=Numeric Declare Var=$Ignore Type=Boolean Declare Var=$InputFile Type=String Declare Var=$j Type=Numeric Declare Var=$k Type=Numeric Declare Var=$leap Type=Numeric Declare Var=$line Type=String Declare Var=$list Type=String Declare Var=$list2 Type=String Declare Var=$Log Type=String Declare Var=$LogDate Type=Date Declare Var=$LogFound Type=Boolean Declare Var=$LogText Type=String Declare Var=$LogTextFile Type=String Declare Var=$lt Type=String Declare Var=$Maintenance Type=Boolean Declare Var=$MatchDatabase Type=String Declare Var=$memoupdated Type=String Declare Var=$Minutes Type=Numeric Declare Var=$MinuteString Type=String Declare Var=$Model Type=String Declare Var=$MoveCopy Type=String Declare Var=$msg Type=String Declare Var=$NoneButton Type=Boolean Declare Var=$NotesString Type=String Declare Var=$NoteText Type=String Declare Var=$OldSplitScreen Type=String Declare Var=$OutputDateTime Type=String Declare Var=$OutputFile Type=String Declare Var=$OutputLog Type=String Declare Var=$OutputStatus Type=String Declare Var=$Over500List Type=String Declare Var=$Over500Caches Type=String Declare Var=$Over500LogText Type=String Declare Var=$Over500Name Type=String DECLARE Var=$ReplaceButton Type=Boolean Declare Var=$result Type=String Declare Var=$Separator Type=String Declare Var=$skipedit Type=Boolean Declare Var=$sql Type=String Declare Var=$SQLData Type=String Declare Var=$Status Type=String Declare Var=$SWver Type=Numeric Declare Var=$SWversion Type=String Declare Var=$Text Type=String Declare Var=$TimeButton Type=Boolean Declare Var=$TimeStr Type=String Declare Var=$TimeZoneOffset Type=Numeric Declare Var=$TimeZoneString Type=String Declare Var=$UserFlagCheckbox Type=Boolean Declare Var=$UserLogButton Type=Boolean Declare Var=$UserNotesButton Type=Boolean Declare Var=$UserSortCheckbox Type=Boolean Declare Var=$variables Type=String Declare Var=$work Type=String Declare Var=$XMLFile Type=String Declare Var=$Year Type=Date Declare Var=$CurrentFounds Type=Numeric Declare Var=$C_total Type=Numeric ENDSUB name=DeclareVariables <Data> VarName=$form3 #******************************************************************** # Form generated by GSAK form designer on Thu 18-Sep-2008 10:29:31 #******************************************************************** Name = Form1 Type = Form Height = 600 Width = 600 Name = LogText Type = Memo Height = 280 Left = 20 Scrollbars = Vertical Top = 211 Width = 551 Taborder = 8 Name = OK Type = Button Height = 25 Left = 53 Top = 521 Width = 100 Taborder = 9 Caption = OK / Next Log Name = Cancel Type = Button Height = 25 Left = 443 Top = 521 Width = 100 Taborder = 10 Caption = Cancel Macro Name = CacheName Type = Label Color = 16744448 Height = 15 Left = 21 Size = 9 Style = bold Top = 181 Width = 49 Caption = Log for: Name = skip Type = Button Height = 25 Left = 313 Top = 521 Width = 100 Taborder = 11 Caption = Skip Editing Logs Name = NoteText Type = Memo Height = 89 Left = 20 Scrollbars = Vertical Top = 50 Width = 551 Taborder = 12 Name = Notename Type = Label Color = 16744448 Height = 15 Left = 21 Size = 9 Style = bold Top = 20 Width = 55 Caption = Note for: Name = SpellCheck Type = Button Height = 25 Left = 183 Spellcheck = LogText Top = 521 Width = 100 Taborder = 13 Caption = Spell Check <enddata> ######################## <Data> VarName=$form #******************************************************************** # Form generated by GSAK form designer on Thu 09-Oct-2008 22:46:24 #******************************************************************** Name = Autologging60csx Type = Form Height = 554 Width = 576 Name = PrefixGroupbox Type = Groupbox Caption = Prefix log comments Height = 77 Left = 14 Top = 316 Width = 185 Taborder = 4 Name = SectionGroupbox Type = Groupbox Caption = Section to place FieldNote Data Height = 77 Left = 214 Top = 316 Width = 177 Taborder = 5 Name = UpdateGroupbox Type = Groupbox Caption = How to update? Height = 77 Left = 407 Top = 316 Width = 146 Taborder = 6 Name = Groupbox2 Type = Groupbox Height = 31 Left = 128 Top = 217 Width = 311 Taborder = 13 Name = FixedTextGroup Type = Groupbox Height = 31 Left = 16 Top = 393 Width = 328 Taborder = 14 Name = Groupbox1 Type = Groupbox Height = 31 Left = 352 Top = 392 Width = 177 Taborder = 16 Name = TimeZoneString Type = Combobox Height = 21 Left = 200 Top = 280 Values = -12;-11;-10;-9;-8;-7;-6;-5;-4;-3;-2;-1;0;1;2;3;4;5;6;7;8;9;10;11;12 Width = 41 Taborder = 1 Name = TimeZoneLabel Type = Label Height = 13 Left = 16 Top = 284 Width = 155 Caption = Time Zone Offset (+/- from GMT) Name = TitleLabel Type = Label Height = 20 Left = 151 Size = 12 Style = bold Top = 16 Width = 253 Caption = 60CSX Automated Logging tool Name = Cancel Type = Button Height = 25 Left = 474 Top = 435 Width = 75 Taborder = 7 Caption = Cancel Name = OK Type = Button Height = 25 Left = 19 Top = 435 Width = 135 Taborder = 8 Caption = 1 Generate Found file Name = DescriptionLabel Type = Label Height = 13 Left = 49 Top = 49 Width = 403 Caption = This macro was designed to process Garmin Colorado/Oregon generated Field Notes. Name = FunctionLabel Type = Label Height = 13 Left = 51 Top = 73 Width = 468 Caption = GSAK will match the waypoints in this file by code, and update the found (or DNF) status and dates, Name = FunctionLabel2 Type = Label Height = 13 Left = 51 Top = 88 Width = 266 Caption = and add any logs into the selected GSAK notes section. Name = TimeButton Type = Radiobutton Container = PrefixGroupbox Height = 17 Left = 8 Top = 19 Width = 15 Taborder = 0 Name = TimeLabel Type = Label Container = PrefixGroupbox Height = 13 Left = 24 Top = 21 Width = 45 Caption = Time only Name = DateButton Type = Radiobutton Container = PrefixGroupbox Height = 17 Left = 101 Top = 19 Width = 15 Taborder = 1 Name = DateLabel Type = Label Container = PrefixGroupbox Height = 13 Left = 117 Top = 21 Width = 45 Caption = Date only Name = DateTimeButton Type = Radiobutton Container = PrefixGroupbox Height = 17 Left = 8 Top = 43 Width = 15 Taborder = 2 Name = TimeDateLabel Type = Label Container = PrefixGroupbox Height = 13 Left = 24 Top = 44 Width = 70 Caption = Date and Time Name = NoneButton Type = Radiobutton Container = PrefixGroupbox Height = 17 Left = 101 Top = 43 Width = 15 Taborder = 3 Name = NoneLabel Type = Label Container = PrefixGroupbox Height = 13 Left = 117 Top = 45 Width = 26 Caption = None Name = UserLogButton Type = Radiobutton Container = SectionGroupbox Height = 17 Left = 16 Top = 36 Width = 15 Taborder = 0 Name = UserLogLabel Type = Label Container = SectionGroupbox Height = 13 Left = 32 Top = 37 Width = 43 Caption = User Log Name = UserNotesButton Type = Radiobutton Container = SectionGroupbox Height = 17 Left = 87 Top = 37 Width = 15 Taborder = 1 Name = UserNotesLabel Type = Label Container = SectionGroupbox Height = 13 Left = 102 Top = 39 Width = 53 Caption = User Notes Name = ReplaceButton Type = Radiobutton Container = UpdateGroupbox Height = 17 Left = 16 Top = 39 Width = 15 Taborder = 0 Name = ReplaceLabel Type = Label Container = UpdateGroupbox Height = 13 Left = 33 Top = 40 Width = 40 Caption = Replace Name = AddButton Type = Radiobutton Container = UpdateGroupbox Height = 17 Left = 80 Top = 39 Width = 15 Taborder = 1 Name = AddLabel Type = Label Container = UpdateGroupbox Height = 13 Left = 96 Top = 39 Width = 19 Caption = Add Name = UserFlagCheckbox Type = Checkbox Height = 17 Left = 249 Top = 282 Width = 15 Taborder = 2 Name = UserFlagLabel Type = Label Height = 13 Left = 265 Top = 284 Width = 109 Caption = Set user flag if updated Name = UserSortCheckbox Type = Checkbox Height = 17 Left = 385 Top = 282 Width = 15 Taborder = 3 Name = UserSortLabel Type = Label Height = 13 Left = 401 Top = 284 Width = 162 Caption = Update User Sort with YYYHHMM Name = DatabaseLabel Type = Label Height = 13 Left = 17 Top = 123 Width = 106 Caption = Select input database: Name = MatchDatabase Type = Combobox Height = 21 Left = 200 Top = 120 Values = $Databases Width = 145 Taborder = 0 Name = Create Type = Button Height = 25 Left = 164 Top = 435 Width = 135 Taborder = 9 Caption = 2. Create File for GC Name = Label2 Type = Label Height = 13 Left = 17 Top = 154 Width = 91 Caption = Output file location: Name = Filepath Type = Folder Height = 21 Left = 200 Top = 150 Width = 251 Taborder = 10 Name = GPX Type = Button Height = 25 Left = 309 Top = 435 Width = 135 Taborder = 11 Caption = 3. GPX + Move to Found Name = Label1 Type = Label Height = 13 Left = 17 Top = 188 Width = 121 Caption = Found Caches Database: Name = FoundDatabase Type = Combobox Height = 21 Left = 200 Top = 185 Values = $Databases Width = 145 Taborder = 12 Name = Ignore Type = Checkbox Container = Groupbox2 Height = 17 Left = 15 Top = 9 Width = 15 Taborder = 0 Name = IgnoreLabel Type = Label Container = Groupbox2 Height = 16 Left = 37 Size = 10 Top = 9 Width = 109 Caption = Ignore logs before Name = FixedTextBox Type = Checkbox Container = FixedTextGroup Height = 17 Left = 11 Top = 9 Width = 15 Taborder = 0 Name = Label3 Type = Label Container = FixedTextGroup Height = 13 Left = 32 Top = 10 Width = 181 Caption = Add fixed text to beginning of each log Name = FixedTextButton Type = Button Container = FixedTextGroup Height = 15 Left = 247 Top = 10 Width = 65 Taborder = 1 Caption = Edit Text Name = settings Type = Button Enabled = Yes Height = 25 Left = 16 Top = 472 Width = 135 Taborder = 15 Caption = Save Settings Name = Label4 Type = Label Container = Groupbox1 Height = 13 Left = 5 Top = 10 Width = 87 Caption = Current found total Name = C_total Type = Edit Container = Groupbox1 Height = 21 Left = 104 Top = 8 Width = 65 Taborder = 0 <enddata> <Data> VarName=$form4 #******************************************************************** # Form generated by GSAK form designer on Fri 18-Apr-2008 18:44:02 #******************************************************************** Name = Form4 Type = Form Height = 404 Width = 220 Name = MemoUpdated Type = Memo Height = 271 Left = 22 Scrollbars = Vertical Top = 50 Width = 167 Taborder = 8 Name = MemoOK Type = Button Height = 25 Left = 68 Top = 340 Width = 75 Taborder = 9 Caption = OK Name = Label1 Type = Label Height = 20 Left = 45 Size = 12 Top = 10 Width = 120 Caption = Caches Updated <enddata> <Data> VarName=$form5 #******************************************************************** # Form generated by GSAK form designer on Tue 08-Jul-2008 22:25:26 #******************************************************************** Name = Form5 Type = Form Height = 157 Width = 247 Name = OKDelete Type = Button Height = 25 Left = 30 Top = 81 Width = 75 Taborder = 8 Caption = Delete Name = CancelDelete Type = Button Height = 25 Left = 130 Top = 81 Width = 75 Taborder = 9 Caption = Cancel Name = Label1 Type = Label Height = 15 Left = 23 Size = 9 Top = 20 Width = 193 Caption = OK to Delete geocache_visits.txt file Name = Label2 Type = Label Height = 15 Left = 67 Size = 9 Top = 41 Width = 105 Caption = from the Colorado? <enddata> <Data> VarName=$form6 #******************************************************************** # Form generated by GSAK form designer on Sat 30-Aug-2008 17:47:33 #******************************************************************** Name = Form6 Type = Form Height = 300 Width = 500 Name = FixedText Type = Memo Height = 151 Left = 46 Scrollbars = Vertical Top = 60 Width = 400 Taborder = 8 Name = Label1 Type = Label Height = 24 Left = 170 Size = 14 Top = 11 Width = 144 Caption = Fixed Text Editor Name = FixedOK Type = Button Height = 25 Left = 88 Top = 230 Width = 75 Taborder = 9 Caption = OK Name = FixedSpell Type = Button Height = 25 Left = 208 Spellcheck = FixedText Top = 230 Width = 75 Taborder = 10 Caption = Spell Check Name = FixedCancel Type = Button Height = 25 Left = 328 Top = 230 Width = 75 Taborder = 11 Caption = Cancel <enddata> <Data> VarName=$form7 #******************************************************************** # Form generated by GSAK form designer on Wed 17-Sep-2008 19:51:23 #******************************************************************** Name = Form7 Type = Form Height = 495 Width = 604 Name = Over500Caches Type = Combobox Exitonchange = Yes Height = 21 Left = 225 Top = 87 Values = $Over500List Width = 145 Taborder = 8 Name = Over500LogText Type = Memo Height = 241 Left = 52 Scrollbars = Vertical Top = 164 Width = 491 Taborder = 9 Name = Label1 Type = Label Height = 20 Left = 178 Size = 12 Style = bold Top = 10 Width = 240 Caption = Logs with over 500 characters Name = Label2 Type = Label Height = 13 Left = 178 Top = 39 Width = 240 Caption = These caches have logs with over 500 characters. Name = Label3 Type = Label Height = 13 Left = 40 Top = 57 Width = 515 Caption = Select one to display it and to automatically Copy it into the Clipboard ready for pasting into the log on GC.com Name = Over500Exit Type = Button Height = 25 Left = 260 Top = 426 Width = 75 Taborder = 10 Caption = Exit Name = Over500Name Type = Label Color = 16744448 Height = 16 Left = 60 Size = 10 Style = bold Top = 130 Width = 52 Caption = Log for: <enddata>
Smurfin & Grote Smurf Geplaatst 5 januari 2009 Geplaatst 5 januari 2009 Sterke tekst voor op een forum .
Lepman Geplaatst 5 januari 2009 Geplaatst 5 januari 2009 Beetje errug veel/lange code. Volgende keer a.u.b. een linkje naar een textfile
Le Comte Geplaatst 5 januari 2009 Geplaatst 5 januari 2009 Sterke tekst voor op een forum . Ja heerlijk: techie-talk!
geo_taz Geplaatst 5 januari 2009 Geplaatst 5 januari 2009 Is het wellicht een idee om deze enhancement op het GSAK macro-forum aan te bieden? Dat heeft het voordeel dat de rest van de wereld er ook van kan profiteren
Track_leader Geplaatst 5 januari 2009 Geplaatst 5 januari 2009 (bewerkt) hmm code was langer dan ik dacht.... sorry ik zal het niet meer doen macro text beschrijving (was van toepassing op een eigen activiteit maar is generiek genoeg) ipv een neiwue DB maken gebruik je de DB die je hebt met je eigen founds... de rest is verder wel te volgen denk ik 5 januari 2009 bewerkt door Track_leader
Track_leader Geplaatst 5 januari 2009 Geplaatst 5 januari 2009 Is het wellicht een idee om deze enhancement op het GSAK macro-forum aan te bieden? Dat heeft het voordeel dat de rest van de wereld er ook van kan profiteren Ga ik doen, alleen nog even de ruwe kantjes er af halen
Aanbevolen berichten
Maak een account aan of meld je aan om een opmerking te plaatsen
Je moet lid zijn om een opmerking achter te kunnen laten
Account aanmaken
Maak een account aan in onze gemeenschap. Het is makkelijk!
Registreer een nieuw accountAanmelden
Ben je al lid? Meld je hier aan.
Nu aanmelden