Jump to content

Recce

Active Members
  • Posts

    48
  • Joined

  • Last visited

Recce's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. RapidQueuer has saved me a lot of time. Thanks for your hard work. Best regards /Thomas
  2. Thanks 4 updating RapidQueuer! Version 2.4 is running great. /Thomas
  3. Thanks Datenshi! Nice knowing that you are fighting this bug. /Thomas
  4. I found the answer: GUIDelete() Not sure my brain is made for programming Thank God this forum exists!
  5. Thank you Authenticity!! It works very well. Can I make the GUI box disappear when the button is pressed? Now the GUI stays open until the process has finished.
  6. Thanks Authenticity! I am having trouble using the OnAutoItExit() function. I prefers this because I cannot understands the "Message-loop Mode" so I stick to OnEvent Mode But how do I define when this OnAutoItExit() Func should be called? It only needs to be called when the Func OKButton, Sporbutton and PDAbutton are called, not when CANCELbutton is called? Kind Regards /Thomas
  7. I replaced an MsgBox with a GUI box, but the script stops after the GUI box, unlike the MsgBox? Please help a noob! Thomas #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_icon=S2G4.ico #AutoIt3Wrapper_outfile=SHP2GPX.exe #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <ButtonConstants.au3> #include "CustomMsgBox.au3" #include <Misc.au3> #Include <File.au3> #include <Process.au3> _Singleton("TheNameOfMyScript") Opt("WinWaitDelay",100) Opt("WinTitleMatchMode",2) Opt("WinDetectHiddenText",1) Opt("MouseCoordMode",0) Opt("GUIOnEventMode", 1) ; Change to OnEvent mode HotKeySet("{ESC}", "Exitkey") ; HotKey set to ESC Func Exitkey() MsgBox(262192,"Mission Planning Utility","Du har afsluttet progammet ved at trykke på ""Esc"".") FileDelete("C:\Pfps\MPU\SHP2GPX\LOWRANCE.usr") FileDelete("C:\Pfps\MPU\SHP2GPX\*.gpx") FileDelete("C:\Pfps\MPU\SHP2GPX\*.gdb") FileSetTime ( "C:\Pfps\MPU\SHP2GPX\Input SHP\FalconView Shape - Overskriv denne fil.shp", "20031101010101" , "0", "0") Exit EndFunc ;Tjek fil overskrevet _line $tjek = FileGetTime ("C:\Pfps\MPU\SHP2GPX\Input SHP\FalconView Shape - Overskriv denne fil.shp" , "0" , "1" ) $realtime = 20031101010101 ;Tjek fil overskrevet If FileExists("C:\Pfps\MPU\SHP2GPX\Input SHP\FalconView Shape - Overskriv denne fil_line.shp") Then $tjek = 20081101010101 EndIf ;Tjek fil overskrevet _poly If FileExists("C:\Pfps\MPU\SHP2GPX\Input SHP\FalconView Shape - Overskriv denne fil_poly.shp") Then $tjek = 20081101010101 EndIf ;Kildefilen er ikke opdateret MsgBox org $ja = 0 If $tjek = $realtime Then $ja = MsgBox(262208, "Mission Planning Utility", "Kildefilen (tegningen) kan ikke findes!" & @CRLF & @CRLF & "Kontroller venligst følgende når tegningen gemmes i FalconView: " & @CRLF & "- Sti: C:\Pfps\MPU\SHP2GPX\Input SHP\FalconView Shape - Overskriv denne fil.shp " & @CRLF & "- Filtype: Shape Files (*.shp) " & @CRLF & "- Overskriv den eksisterende fil " & @CRLF & @CRLF & "Program Afsluttet") If $ja = 1 Then Exit EndIf If $tjek =0 Then ;Cleaner input folder FileDelete("C:\Pfps\MPU\SHP2GPX\Input SHP\*.*") FileCopy("C:\Pfps\MPU\SHP2GPX\FalconView Shape - Overskriv denne fil.dbf_org", "C:\Pfps\MPU\SHP2GPX\Input SHP\FalconView Shape - Overskriv denne fil.dbf", "9") FileCopy("C:\Pfps\MPU\SHP2GPX\FalconView Shape - Overskriv denne fil.shp_org", "C:\Pfps\MPU\SHP2GPX\Input SHP\FalconView Shape - Overskriv denne fil.shp", "9") FileCopy("C:\Pfps\MPU\SHP2GPX\FalconView Shape - Overskriv denne fil.shx_org", "C:\Pfps\MPU\SHP2GPX\Input SHP\FalconView Shape - Overskriv denne fil.shx", "9") FileCopy("C:\Pfps\MPU\SHP2GPX\Desktop.ini_org", "C:\Pfps\MPU\SHP2GPX\Input SHP\Desktop.ini", "9") FileCopy("C:\Pfps\MPU\SHP2GPX\Husk! - Skift til - Shape Files (¤.shp).drw_org", "C:\Pfps\MPU\SHP2GPX\Input SHP\Husk! - Skift til - Shape Files (¤.shp).drw", "9") ;Sætter tid FileSetTime ( "C:\Pfps\MPU\SHP2GPX\Input SHP\FalconView Shape - Overskriv denne fil.shp", "20031101010101" , "0", "0") ;Melder fejl om fil MsgBox(262208, "Mission Planning Utility", "Kildefilen (tegningen) kan ikke findes!" & @CRLF & @CRLF & "Kontroller venligst følgende når tegningen gemmes i FalconView: " & @CRLF & "- Sti: C:\Pfps\MPU\SHP2GPX\Input SHP\FalconView Shape - Overskriv denne fil.shp " & @CRLF & "- Filtype: Shape Files (*.shp) " & @CRLF & "- Overskriv den eksisterende fil " & @CRLF & @CRLF & "Program Afsluttet") Exit EndIf ; Slet Output GPX FileDelete("C:\Pfps\MPU\SHP2GPX\Output GPX\MapSource GPX file.gpx") ;Global Mapper SHP-->C:\Pfps\MPU\SHP2GPX\LOWRANCE.usr ShellExecuteWait("C:\Pfps\MPU\SHP2GPX\shp2gpx_script.gms" , "" , "C:\Pfps\MPU\SHP2GPX\") If @error Then MsgBox(262192,"Mission Planning Utility","Global Mapper svarer ikke"& @CRLF & @CRLF & "Expoteringen kan ikke fortsættes og er standset." & @CRLF & @CRLF & "Geninstaller Global Mapper v.903 eller nyere") FileDelete("C:\Pfps\MPU\SHP2GPX\LOWRANCE.usr") FileDelete("C:\Pfps\MPU\SHP2GPX\*.gpx") FileDelete("C:\Pfps\MPU\SHP2GPX\*.gdb") FileSetTime ( "C:\Pfps\MPU\SHP2GPX\Input SHP\FalconView Shape - Overskriv denne fil.shp", "20031101010101" , "0", "0") Exit EndIf ;Vent til C:\Pfps\MPU\SHP2GPX\LOWRANCE.usr er oprettet $l=0 Do Sleep(99) $l = $l + 1 If $l = 100 Then ExitLoop Until FileExists("C:\Pfps\MPU\SHP2GPX\LOWRANCE.usr") ; Hvis tom SHP fil Melder fejl og lukker. $fejl = 1 $fejl = FileExists("C:\Pfps\MPU\SHP2GPX\LOWRANCE.usr") If $fejl = 0 Then MsgBox(262160,"Error", "Tom kildefil (tegening)" & @CRLF & @CRLF & "Prøv igen med ny tegning" & @CRLF & @CRLF & "Program afsluttet") Exit EndIf ; GpsBable fra USR-->GPX TEMP fil Se Bat fil ;RunWait ("GPSBable_script.exe", "C:\Pfps\MPU\SHP2GPX\") RunWait(@ComSpec & ' /c ' & 'C:\Pfps\MPU\KML2GPX\gpsbabel -i lowranceusr -f "C:\Pfps\MPU\SHP2GPX\LOWRANCE.usr" -x nuketypes,waypoints -o gpx -F "C:\Pfps\MPU\SHP2GPX\temp.gpx"','', @SW_HIDE) $mainwindow = GUICreate("Mission Planning Utility", 530, 100, -1, -1,BitOr($WS_CAPTION,$WS_POPUP,$WS_SYSMENU),$WS_EX_TOPMOST) GUISetIcon("C:\Pfps\MPU\SHP2GPX\S2G4.ico") GUICtrlCreateIcon ("shell32.dll", 1001, 20, 10, 32, 32, -1) GUISetOnEvent($GUI_EVENT_CLOSE, "CLOSEClicked") GUICtrlCreateLabel("Denne knap vil overføre tegninger fra FalconView til MapSource/PDA som Spor eller Rute.", 70, 20) $Sporbutton = GUICtrlCreateButton("Spor", 100, 50, 60) $okbutton = GUICtrlCreateButton("Rute", 190, 50, 60) $PDAbutton = GUICtrlCreateButton("PDA", 280, 50, 60) $CANCELbutton = GUICtrlCreateButton("Cancel", 370, 50, 60) GUICtrlSetOnEvent($okbutton, "OKButton") GUICtrlSetOnEvent($Sporbutton, "Sporbutton") GUICtrlSetOnEvent($PDAbutton, "PDAbutton") GUICtrlSetOnEvent($CANCELbutton, "CANCELbutton") GUISetState(@SW_SHOW) While 1 Sleep(1000) ; Idle around WEnd Func OKButton() ;RUTE TrayTip("For at afbryde:", " Tryk Esc", 999, 1) ;RunWait ("GPSBable_script_route.exe", "C:\Pfps\MPU\SHP2GPX\") RunWait(@ComSpec & ' /c ' & 'C:\Pfps\MPU\KML2GPX\gpsbabel -i gpx -f "C:\Pfps\MPU\SHP2GPX\temp.gpx" -x transform,rte=trk,del -o gpx -F "C:\Pfps\MPU\SHP2GPX\temp2.gpx"','', @SW_HIDE) $k=0 Do Sleep(99) $k = $k + 1 If $k = 100 Then ExitLoop Until FileExists("C:\Pfps\MPU\SHP2GPX\temp2.gpx") ;RunWait ("GPSBable_script_route2.exe", "C:\Pfps\MPU\SHP2GPX\") RunWait(@ComSpec & ' /c ' & 'C:\Pfps\MPU\KML2GPX\gpsbabel -i gpx -f "C:\Pfps\MPU\SHP2GPX\temp2.gpx" -x transform,wpt=rte -o gdb -F "C:\Pfps\MPU\SHP2GPX\temp3.gdb"','', @SW_HIDE) $k2=0 Do Sleep(99) $k2 = $k2 + 1 If $k2 = 100 Then ExitLoop Until FileExists("C:\Pfps\MPU\SHP2GPX\temp3.gdb") ;RunWait ("GPSBable_script_route3.exe", "C:\Pfps\MPU\SHP2GPX\") RunWait(@ComSpec & ' /c ' & 'C:\Pfps\MPU\KML2GPX\gpsbabel -i gdb -f "C:\Pfps\MPU\SHP2GPX\temp3.gdb" -o gpx -F "C:\Pfps\MPU\SHP2GPX\Output GPX\MapSource GPX file.gpx"','', @SW_HIDE) EndFunc Func Sporbutton() TrayTip("For at afbryde:", " Tryk Esc", 999, 1) FileCopy("C:\Pfps\MPU\SHP2GPX\temp.gpx", "C:\Pfps\MPU\SHP2GPX\Output GPX\MapSource GPX file.gpx", "9") EndFunc Func CLOSEClicked() ;Note: at this point @GUI_CTRLID would equal $GUI_EVENT_CLOSE, ;and @GUI_WINHANDLE would equal $mainwindow Exit EndFunc Func PDAbutton() MsgBox(4096, "Test", "PDA", 10) Exit EndFunc Func CANCELbutton() Exit EndFunc ;Cleaner input folder FileDelete("C:\Pfps\MPU\SHP2GPX\Input SHP\*.*") FileCopy("C:\Pfps\MPU\SHP2GPX\FalconView Shape - Overskriv denne fil.dbf_org", "C:\Pfps\MPU\SHP2GPX\Input SHP\FalconView Shape - Overskriv denne fil.dbf", "9") FileCopy("C:\Pfps\MPU\SHP2GPX\FalconView Shape - Overskriv denne fil.shp_org", "C:\Pfps\MPU\SHP2GPX\Input SHP\FalconView Shape - Overskriv denne fil.shp", "9") FileCopy("C:\Pfps\MPU\SHP2GPX\FalconView Shape - Overskriv denne fil.shx_org", "C:\Pfps\MPU\SHP2GPX\Input SHP\FalconView Shape - Overskriv denne fil.shx", "9") FileCopy("C:\Pfps\MPU\SHP2GPX\Desktop.ini_org", "C:\Pfps\MPU\SHP2GPX\Input SHP\Desktop.ini", "9") FileCopy("C:\Pfps\MPU\SHP2GPX\Husk! - Skift til - Shape Files (¤.shp).drw_org", "C:\Pfps\MPU\SHP2GPX\Input SHP\Husk! - Skift til - Shape Files (¤.shp).drw", "9") ; åben fil i mapsource OLD: Run(@ComSpec & " /c " & 'START "" "c:\Pfps\MPU\SHP2GPX\Output GPX\MapSource GPX file.gdb"', "", @SW_HIDE) ;Vent til GPX filen er skrevet før MapSource åbnes $k3=0 Do Sleep(99) $k3 = $k3 + 1 If $k3 = 100 Then ExitLoop Until FileExists("C:\Pfps\MPU\SHP2GPX\Output GPX\MapSource GPX file.gpx") ; Søger efter mapsource sti $MSpath = 0 $MSpath2 = 0 $MSpath = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Garmin\Applications\MapSource", "InstallDir") $MSpath2 = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\MapSource.exe", "") ; Bekræfter mapsource sti If FileExists ( $MSpath ) = 1 Then Run(@ComSpec & " /c " & '""' & $MSpath & '" "c:\Pfps\MPU\SHP2GPX\Output GPX\MapSource GPX file.gpx"', "", @SW_HIDE) ElseIf FileExists ($MSpath2) = 1 Then Run(@ComSpec & " /c " & '""' & $MSpath2 & '" "c:\Pfps\MPU\SHP2GPX\Output GPX\MapSource GPX file.gpx"', "", @SW_HIDE) ElseIf FileExists ( "C:\MapSource\MapSource.exe") = 1 Then Run(@ComSpec & " /c " & '""' & "C:\MapSource\MapSource.exe" & '" "c:\Pfps\MPU\SHP2GPX\Output GPX\MapSource GPX file.gpx"', "", @SW_HIDE) ElseIf FileExists ( "C:\Garmin\MapSource.exe") = 1 Then Run(@ComSpec & " /c " & '""' & "C:\Garmin\MapSource.exe" & '" "c:\Pfps\MPU\SHP2GPX\Output GPX\MapSource GPX file.gpx"', "", @SW_HIDE) ElseIf FileExists ( "C:\Garmin\MapSource\MapSource.exe") = 1 Then Run(@ComSpec & " /c " & '""' & "C:\Garmin\MapSource\MapSource.exe" & '" "c:\Pfps\MPU\SHP2GPX\Output GPX\MapSource GPX file.gpx"', "", @SW_HIDE) Else MsgBox(16,"", "MapSource kan ikke findes. Prøv at installere MapSource igen") Exit EndIf TrayTip("Mission Planning Utility", " Overførsel fuldført.", 4, 1) Sleep(3000) FileDelete("C:\Pfps\MPU\SHP2GPX\LOWRANCE.usr") FileDelete("C:\Pfps\MPU\SHP2GPX\*.gpx") FileDelete("C:\Pfps\MPU\SHP2GPX\*.gdb") FileSetTime ( "C:\Pfps\MPU\SHP2GPX\Input SHP\FalconView Shape - Overskriv denne fil.shp", "20031101010101" , "0", "0") Exit
  8. Thank you seesoe. This is what I need also. But how to add more files/folders? I can see that it is this string: $sDir = "C:\1\" But how?
  9. Great job ProgAndy! ;=============================================================================== ; ; Function Name: xMsgBox ; Description:: Shows a Message Box with Cutsom Buttons and Optioinal a custom Icon ; Parameter(s): $lFlagType -> MSgBox Flags ; $sPrompt -> Text ; $sTitle -> Title ; $sButtonText1 -> Button1, "" = default Buttons ; $sButtonText2 -> Button2, "" = only 1 Button, if Button 1 defined ; $sButtonText3 -> Button2, "" = 2 Buttons if Button 1 and 2 defined ; $lLeft -> Left Position of MsgBox ; $lTop -> Top Position of MsgBox ; $sIconPath -> Optional: Path of Icon for MsgBox, Default: Empty ; $hwndThreadOwner -> Optional: Handle of owner window ; ; Requirement(s): v3.2.12.0 or higher ; Return Value(s): If no custom ButtonTexts: default MsgBox ; 1 named Button: Closing and Button = 1 ; 2 named Buttons: Button1 = 6, Button2 = 7 ; 3 named Buttons: Button1 = 6, Button2 = 7, Button3 = 2 ; For 2 and 3 Buttons: Closing MsgBox = 2 (cancel) [ ! 3rd named Button is the same ! ] ; Author(s): Prog@ndy ; ;=============================================================================== Where can I find more help to this code?
  10. That did it! I wish I had you brain Authenticity! Thank you very very much!
  11. Thank you once again Authenticity ! But I must be implanting it wrong when AU3Check give me this: >"C:\Programmer\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /prod /AU3Check /in "C:\MPU\Remove_ FV_buttons.au3" +>18:36:38 Starting AutoIt3Wrapper v.1.10.1.14 Environment(Language:0406 Keyboard:00000406 OS:WIN_XP/Service Pack 3 CPU:X86 ANSI) >Running AU3Check (1.54.14.0) from:C:\Programmer\AutoIt3 C:\MPU\Remove_ FV_buttons.au3(22,18) : ERROR: multi-line 'If' missing 'Then'. If $Tmp <> "" ~~~~~~~~~~~~~~~~~^ C:\MPU\Remove_ FV_buttons.au3(27,5) : ERROR: missing Next. EndIf ~~~~^ C:\MPU\Remove_ FV_buttons.au3(20,12) : REF: missing Next. For $i = 1 To ~~~~~~~~~~~^ C:\MPU\Remove_ FV_buttons.au3(27,5) : ERROR: syntax error EndIf ~~~~^ C:\MPU\Remove_ FV_buttons.au3 - 3 error(s), 0 warning(s) !>18:36:38 AU3Check ended.rc:2 +>18:36:38 AutoIt3Wrapper Finished >Exit code: 0 Time: 0.327
  12. I agree! My question is how to implant "RegDelete" in the script. How to know what button number to delete? (Sorry if its a stupid question)
  13. Thank you Authenticity´! Smart use Case and Switch (new to me) But how can I implant this scenario: 1. Button 1 (or any button) is found to have criteria $3 (0r any criteria) 2. Button 1 is deleted using "RegDelete"
  14. I need an input to do this script right (Yes I am a n00b). Its a simple task. Read the registry (keys listed below) and delete all the keys that meet the criterias. But it is a lot of keys and a lot of Criterias. How can this be solved? Using Case or If? Any help is welcome! Keys: RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\PFPS\FalconView\Custom Tools\Button1", "Path") RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\PFPS\FalconView\Custom Tools\Button2", "Path") RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\PFPS\FalconView\Custom Tools\Button3", "Path") RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\PFPS\FalconView\Custom Tools\Button4", "Path") RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\PFPS\FalconView\Custom Tools\Button5", "Path") RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\PFPS\FalconView\Custom Tools\Button6", "Path") RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\PFPS\FalconView\Custom Tools\Button7", "Path") RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\PFPS\FalconView\Custom Tools\Button8", "Path") RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\PFPS\FalconView\Custom Tools\Button9", "Path") RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\PFPS\FalconView\Custom Tools\Button10", "Path") Criterias $1 = "C:\Pfps\MPU\GPX2SHP\GPX2SHP.exe" $2 = "C:\Pfps\MPU\KML2SHP&GPX\KML2SHP&GPX.exe" $3 = "C:\Pfps\MPU\LPT2GPX\LPT2GPX.exe" $4 = "C:\Pfps\MPU\SHP2GPX\SHP2GPX.exe" $5 = "C:\Pfps\MPU\TXT2LPT\TXT2LPT.exe"
  15. I needed to remove the " from: "C:\Pfps\MPU\KML2GPX\gpsbabel.exe" It gives no sense to me but now it works! Thank you all for you patients! JasonLA: I am in the process of transforming a drawing from Google Earth into a GPS track or route.
×
×
  • Create New...