Jump to content

KenNichols

Active Members
  • Posts

    117
  • Joined

  • Last visited

About KenNichols

  • Birthday 11/16/1977

Profile Information

  • Location
    Florida

Recent Profile Visitors

313 profile views

KenNichols's Achievements

Adventurer

Adventurer (3/7)

0

Reputation

  1. You had the " in the wrong spot You want it to look like this: C:\Program Files (x86)\Adobe\Reader 11.0\Reader\AcroRd32.exe /A "page=6" "C:\Predictions\UTC_80.pdf" Try: #include <GUIConstantsEx.au3> #include <EditConstants.au3> $lblPageNumber = GUICtrlCreateLabel("Enter Page #:", 10, 20) $ReadPage = GUICtrlCreateInput("", 10,40,90,20, $ES_NUMBER) ;Numbers Only $page = GUICtrlRead($ReadPage) Run('C:\Program Files (x86)\Adobe\Reader 11.0\Reader\AcroRd32.exe /A "page=' & $page & '" "C:\Predictions\UTC_80.pdf"')
  2. The AutoIT Help file is Awesome, you will find everything you need to get started and then some. The links below contain the same info that's in the Help file. Mouse Move: https://www.autoitscript.com/autoit3/docs/functions/MouseMove.htm Send: https://www.autoitscript.com/autoit3/docs/functions/Send.htm
  3. I am trying to create a GUI Simulator and feel there must be a better way to do it than the way I'm doing it now. I am loading a .jpg and enabling/disabling transparent(made black for this example) labels which load a different picture when clicked. See my code below. It works but I will be working with about 100 pictures total. #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Icon=ico\control_panel.ico #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form=C:\Users\knichols\Desktop\frmMain.kxf $frmMain = GUICreate("Simulator", 1024, 643) $Picture = GUICtrlCreatePic("C:\Simulator\ScreenShots\Image1.jpg", 0, 0,1024,643,$SS_BITMAP) $lblCopy = GUICtrlCreateLabel("", 73, 169, 220, 280) GUICtrlSetBkColor(-1, 000000);$GUI_BKCOLOR_TRANSPARENT GUICtrlSetCursor(-1, 0) $lblPrintFrom = GUICtrlCreateLabel("", 328, 169, 220, 280) GUICtrlSetBkColor(-1, 000000);$GUI_BKCOLOR_TRANSPARENT GUICtrlSetCursor(-1, 0) $lblScanTo = GUICtrlCreateLabel("", 583, 169, 220, 280) GUICtrlSetBkColor(-1, 000000);$GUI_BKCOLOR_TRANSPARENT GUICtrlSetCursor(-1, 0) $lblServicesHome = GUICtrlCreateLabel("", 223, 553, 42, 42) GUICtrlSetBkColor(-1, 000000);$GUI_BKCOLOR_TRANSPARENT GUICtrlSetCursor(-1, 0) $lblJobStatus = GUICtrlCreateLabel("", 473, 553, 42, 42) GUICtrlSetBkColor(-1, 000000);$GUI_BKCOLOR_TRANSPARENT GUICtrlSetCursor(-1, 0) $lblMachineStatus = GUICtrlCreateLabel("", 600, 553, 42, 42) GUICtrlSetBkColor(-1, 000000);$GUI_BKCOLOR_TRANSPARENT GUICtrlSetCursor(-1, 0) $lblOK = GUICtrlCreateLabel("", 733, 124, 94, 34) GUICtrlSetBkColor(-1, 000000);$GUI_BKCOLOR_TRANSPARENT GUICtrlSetCursor(-1, 0) GUICtrlSetState(-1, $GUI_DISABLE) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### Local $bFileInstall = False Local $sFldr = "C:\Simulator\ScreenShots\" If DirGetSize($sFldr) <> -1 Then Local $bFileInstall = False Else DirCreate($sFldr) FileInstall("C:\Users\knichols\Desktop\ScreenShots\Image1.jpg", $sFldr & "Image1.jpg") FileInstall("C:\Users\knichols\Desktop\ScreenShots\Image3.jpg", $sFldr & "Image3.jpg") FileInstall("C:\Users\knichols\Desktop\ScreenShots\Image21.jpg", $sFldr & "Image21.jpg") FileInstall("C:\Users\knichols\Desktop\ScreenShots\Image21.jpg", $sFldr & "Image22.jpg") FileInstall("C:\Users\knichols\Desktop\ScreenShots\Image43.jpg", $sFldr & "Image43.jpg") FileInstall("C:\Users\knichols\Desktop\ScreenShots\Image68.jpg", $sFldr & "Image68.jpg") FileInstall("C:\Users\knichols\Desktop\ScreenShots\Image69.jpg", $sFldr & "Image69.jpg") EndIf While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $lblJobStatus GUICtrlSetImage($Picture, "C:\Simulator\ScreenShots\Image69.jpg") DisableLabels() Case $lblServicesHome GUICtrlSetImage($Picture, "C:\Simulator\ScreenShots\Image1.jpg") EnableLabels() Case $lblMachineStatus GUICtrlSetImage($Picture, "C:\Simulator\ScreenShots\Image43.jpg") DisableLabels() Case $lblCopy GUICtrlSetImage($Picture, "C:\Simulator\ScreenShots\Image3.jpg") DisableLabels() Case $lblPrintFrom GUICtrlSetImage($Picture, "C:\Simulator\ScreenShots\Image68.jpg") DisableLabels() Case $lblScanTo GUICtrlSetImage($Picture, "C:\Simulator\ScreenShots\Image21.jpg") GUICtrlSetState($lblOK, $GUI_ENABLE) DisableLabels() Case $lblOK GUICtrlSetImage($Picture, "C:\Simulator\ScreenShots\Image22.jpg") GUICtrlSetState($lblOK, $GUI_DISABLE) EndSwitch WEnd Func DisableLabels() GUICtrlSetState($lblCopy,$GUI_DISABLE) GUICtrlSetState($lblScanTo,$GUI_DISABLE) GUICtrlSetState($lblPrintFrom,$GUI_DISABLE) EndFunc Func EnableLabels() GUICtrlSetState($lblCopy,$GUI_ENABLE) GUICtrlSetState($lblScanTo,$GUI_ENABLE) GUICtrlSetState($lblPrintFrom,$GUI_ENABLE) EndFunc
  4. I need help converting an ANSI CSV file to a Unicode CSV file. The ANSI CSV file may contain a line like: 18,"Alpha, Beta & Capa","1234567","","",0,0,"","","","","",0,0,0,"",0,0,"","","","",0,0,0 When I use the below code to create the Unicode CSV file it converts ALL commas to chr(9) aka Horizontal Tab. I need the commas within the "" to remain. What can I do to fix this? Code Sample: $ANSI = FileRead($FileToConvert) $ANSI2 = StringReplace($ANSI,'"','') $Unicode = FileOpen($Converted,32+2) ;32=Unicode FileWrite($Unicode, $ANSI2) FileClose($Unicode)Any Help is appreciated.
  5. I have never used StringRegExpReplace. I will have to do some homework to fully understand it. The code you provide got me much closer to my desired result. With some tweaking I think it will be perfect. Thank You! You have been a huge help!
  6. StringStripWS Remarks:Whitespace includes Chr(9) thru Chr(13) which are HorizontalTab, LineFeed, VerticalTab, FormFeed, and CarriageReturn. Whitespace also includes the null string ( Chr(0) ) and the standard space ( Chr(32) ). How else can I strip the nulls?
  7. I search the entire PDF too much to paste.$txt = FileRead($file)
  8. SmOke,That makes sense, but shouldn't the StringStripWS take care of that? Even when I use StringStripWS it returns the same value.
  9. It Returns: [0]| (þÿ
  10. With the below code _StringBetween returns "(þÿ" it should return: "(þÿ N i t r o P D F P r o f e s s i o n a l )" or "(þÿ M i c r o s o f t ® W o r d 2 0 1 0)" I have also tried: $txt = StringStripWS($txt, 8) What am I missing? #Include <String.au3> #include <file.au3> #include <array.au3> $FilePath = FileOpenDialog("Select PDF", @DesktopDir & "\", "PDF (*.pdf)") $file = FileOpen($FilePath, 0) ; Check if file opened for reading OK If $file = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf $txt = FileRead($file) $Producer = _StringBetween($txt, '/Producer','/') ;$Ascii = StringToASCIIArray($Producer[0]) ;_ArrayDisplay($Ascii) MsgBox(0,"PDF Info", $Producer[0])
  11. Thanks! That is slick!
  12. I know there must be a better way than to add all of the "Or" #include <excel.au3> $ExcelWinList = WinList ("Microsoft Excel") $Title = StringReplace ($ExcelWinList [1] [0], "Microsoft Excel - ", "") $oExcel = _ExcelBookAttach ("Microsoft Excel - " & $Title, "Title") $ActiveCell = $oExcel.Application.ActiveCell.Address If $ActiveCell = "$A$23" Or $ActiveCell = "$A$39" Or $ActiveCell = "$A$59" Or $ActiveCell = "$A$75" Or $ActiveCell = "$A$91" Or $ActiveCell = "$A$112" Or $ActiveCell = "$A$128" Or $ActiveCell = "$A$144" Or $ActiveCell = "$A$160" Or $ActiveCell = "$A$176" Or $ActiveCell = "$A$192" Then MsgBox(0, "Success", "Active Cell = " & $ActiveCell,2) EndIf
  13. I added an IF statment in While 1 and so far so good. Thanks for the help.
  14. x86 is 32Bit
  15. This script works good but I get the following message after a few minutes. Line 54 (File "C:\Program Files (x86)\Automatic Access\Automatic Access.exe"): Error: Recursion level has been exceeded - AutoIt will quit to prevent stack overflow. I have read other posts about this message and I have changed the script several times to try to fix it. However for some reason I can't wrap my head around this problem. What am I doing wrong? #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_icon=Internet.ico #AutoIt3Wrapper_UseX64=n #AutoIt3Wrapper_Res_Description=Automation utility for VZ Access Manager #AutoIt3Wrapper_Res_Fileversion=1.1.0.0 #AutoIt3Wrapper_Res_LegalCopyright=© 2011 Ken Nichols #AutoIt3Wrapper_Res_Language=1033 #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include<Misc.au3> If _Singleton(@ScriptName,1) = 0 Then Exit MsgBox(48,"","Automatic Access is already running.",3) If @Compiled = 1 And FileExists(@ProgramFilesDir & "\Automatic Access\" & @ScriptName) = 0 Or @Compiled = 1 And FileExists(@StartupDir & "\Automatic Access.lnk") = 0 Then $Install = MsgBox(32+4,"Automatic Access","Do you want to install Automatic Access?") Select Case $Install = 6 _Install() MsgBox(64,"Automatic Access","Automatic Access is now installed.") Case $Install = 7 MsgBox(16,"Automatic Access","Automatic Access installation was cancelled!") Exit Case Else MsgBox(0,"Else","Else") EndSelect EndIf If FileExists(@ProgramFilesDir & "\Verizon Wireless\VZAccess Manager\VZAccess Manager.exe") Then $VZDir = @ProgramFilesDir & "\Verizon Wireless\VZAccess Manager\VZAccess Manager.exe" ElseIf FileExists(@ProgramFilesDir & " (x86)\Verizon Wireless\VZAccess Manager\VZAccess Manager.exe") Then $VZDir = @ProgramFilesDir & " (x86)\Verizon Wireless\VZAccess Manager\VZAccess Manager.exe" EndIf ProcessSetPriority(@AutoItPID,1);Set Priority to "Below Normal" While 1 Sleep(250) _VZDetect() WEnd Func _VZDetect() $var = DriveGetDrive( "CDROM" ) If NOT @error Then For $i = 1 to $var[0] $Label = DriveGetLabel($var[$i]) $Status = DriveStatus($var[$i]) If $Label = "VZAccess Manager" And $Status = "Ready" And ProcessExists("VZAccess Manager.exe") = 0 Then Run($VZDir) WinWait("VZAccess Manager","") If WinExists("AutoPlay","VZAccess Manager") Then WinClose("AutoPlay","VZAccess Manager") EndIf Sleep(200);Allow time for window to load While ControlCommand ("VZAccess Manager","", 1003,"IsEnabled","") = 0 ;And WinExists("VZAccess Manager","") = 1 Sleep(200) WEnd If WinExists("AutoPlay","VZAccess Manager") Then WinClose("AutoPlay","VZAccess Manager") EndIf Sleep(200) ControlClick("VZAccess Manager","",1003);Click Connect Sleep(2000) ControlClick("VZAccess Manager","",1046);Click Minimize - WinSetState ("VZAccess Manager","",@SW_MINIMIZE)Doesn't minimize to systray EndIf Next EndIf EndFunc Func _Install() If @Compiled = 1 And FileExists(@ProgramFilesDir & "\Automatic Access\" & @ScriptName) = 0 Then FileCopy(@ScriptFullPath, @ProgramFilesDir & "\Automatic Access\", 9) ; Flag = 1 + 8 (overwrite + create target directory structure) Sleep(100) EndIf If @compiled = 1 And FileExists(@StartupDir & "\Automatic Access.lnk") = 0 And FileExists(@ProgramFilesDir & "\Automatic Access\" & @ScriptName) = 1 Then FileCreateShortcut(@ProgramFilesDir & "\Automatic Access\" & @ScriptName, @StartupDir & "\Automatic Access.lnk","","","",@ProgramFilesDir & "\Automatic Access\" & @ScriptName,"","0") Sleep(100) EndIf EndFunc
×
×
  • Create New...