Jump to content

jcorr1339

Members
  • Posts

    10
  • Joined

  • Last visited

jcorr1339's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. I did something similar. Check it out. #include <GUIConstants.au3> Opt ( "GUICloseOnESC", 0) Opt ( "GUIOnEventMode", 1) _StartHereGUI() While 1 = 1 Sleep(30) Wend Func _StartHereGUI();Builds the first GUI window; GuiCreate("Computer Speak", 452, 340,(@DesktopWidth-452)/2, (@DesktopHeight-391)/2 , $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS) GuiCtrlCreateButton("Speak", 70, 265, 70, 30) GuiCtrlCreateButton("Clipboard", 190, 265, 70, 30) GuiCtrlCreateButton("Exit", 310, 265, 70, 30) GuiCtrlCreateInput("", 205, 40, 190, 20) GuiCtrlCreateLabel("", 70, 80, 320, 150) GuiCtrlCreateLabel("Have the computer speak:", 70, 40, 130, 30) GUICtrlSetOnEvent(3, "_SpeakButton");OnEvent functions are only called when GUIOnEventMode is set. GUICtrlSetOnEvent(4, "_ClipBoardBtn");OnEvent functions are only called GUICtrlSetOnEvent(5, "_Exit");OnEvent functions are only called GUISetOnEvent ($GUI_EVENT_CLOSE, "_ClosedBtn") GUISetState(@SW_SHOW) EndFunc Func _SpeakButton();Action for the speak Btn; $Input = GUICtrlRead(6) _StartHereGUI() GUISetState(@SW_HIDE) $talk = ObjCreate("SAPI.SpVoice") $talk.Speak($Input) EndFunc Func _ClipBoardBtn();Action for the clipboard Btn; $clip = ClipGet() GUICtrlSetData(7,$clip) $talk = ObjCreate("SAPI.SpVoice") $talk.Speak($clip) EndFunc Func _Exit();Action for the close Btn; GUIDelete () Exit EndFunc Func _ClosedBtn();Action for the close Btn; GUIDelete () Exit EndFunc
  2. Anthing new on this topic??? I have a big need to update CE4.2 devices for work. Any thoughts?
  3. Ok, Got it solved. Man I am thick. I should have seen this from a mile away. The problem is a bug(feature) with how clipget() interfaces with Excel. Excel seems to be the standard fro SS apps, so I am shocked I could not find any posts with the same issue. I used 2 diff versions of Excel and this little script to debug. If someone can show me otherwise or let me know the "real" reason its acting this way please do so. Hope this can be of use to others: Here we go- The final solution was to use the StringStripWS() cmd to get rid of the unwantted characters. To validate have 10.22.211.69 in an Excel cell. then run the code: ;Debug process for input text ;Start by getting text off the clipboad from execl $IP=clipget() ;Display the number of charactrers on the clipboard MsgBox(0,"Pasted from Clipboard", "Clip board contains: " & StringLen ($IP) & " characters." & @CRLF & "Clip board: " & ClipGet()) ;Test what it looks like pasted from the clipboard into an input field InputBox("test","",$IP) ;Remove all white spaces from the Excel field MsgBox(0,"Removal of returns and spaces", "Now the strip") $IP=StringStripWS($IP, 8) InputBox("Extra spaces removed","",$IP) Well, I can't say its been completly fun, but now I can update my 2,600qty stinkin printers before the 5th (deadline), Which should save me about 100hrs of O&M. Now back to the weekend............. MmmmmmmmBeeeeer.
  4. I have sent the output to an inputbox as a little debug. here is a pic of what I get. Some extra data being picked up from excel. Any ideas?
  5. I believe the issue to be a bug with the clipget() function using the & operator from excel. I used the clipget() function with word, and notepad with no issues joining the string together with &. Am I going crazy>? Can someone else verify this as well? Code: #include <Process.au3> $IP=clipget() _RunDos("start http://" & $IP & "/port_0/config/general")
  6. I will try calling the second script as a function, never thought of that... still a Noob. As for the difference in numers, its just an example of what I was doing. I have spent sooo much time doing diff combos, @compsec and _RunDos. They do match on the combined script. If you have time could you review the combined? Its an attachmet above, Thanks - I am under the gun with the holiday weekend. I will include it here as well. Code: ;Combined script ; ---------------------------------------------------------------------------- ; 6/30/05 ; Lexmark Printer WH Name and Address update ; ---------------------------------------------------------------------------- #include <Process.au3> Dim $IP ; lookup from col "A" on SS Dim $ContactName ; lookup from col "B" on SS Dim $LocationName ; lookup from col "C" on SS Dim $OpenWeb ; Launches the web-interface $A = "A" ; Starting Cell Reference $1 = 1 ; Starting Cell Reference Do ;All the code needed for one full loop; $combo = $A & $1 $IP=getcell($combo) Send("{right}") ControlSend("Microsoft Excel","","XLDESK1","^c"); copies contents $ContactName=clipget(); move clipboard to $ContactName ControlSend("Microsoft Excel","","XLDESK1","{esc}"); return excel to normal state Send("{right}") ControlSend("Microsoft Excel","","XLDESK1","^c"); copies contents $LocationName=clipget(); move clipboard to $LocationName ControlSend("Microsoft Excel","","XLDESK1","{esc}"); return excel to normal state MsgBox(0,"output", $IP & $ContactName & $LocationName) ; Just validates my output is what I want $OpenWeb=_RunDos("start http://" & $IP & "/port_0/config/general") ;To be called as from the START menu ;Wait for print server window to be activly loaded, then send the following; WinWaitActive("Print Server Settings - Microsoft Internet Explorer","") Sleep(3000) Send("{Tab}") Send("{Tab}") Send($ContactName) Send("{Tab}") Send("{CTRLDOWN}a{CTRLUP}{BACKSPACE}") Send($LocationName) Sleep(500) Send("{Enter}") WinWaitActive("Configuration Change Submitted - Microsoft Internet Explorer","") $1 = $1 + 1 ;Start over on next IP, move down one cell Until $1 = 11 ;Number of printers to update xtimes to repeat SoundPlay(@WindowsDir & "\media\tada.wav",1) Func getcell($combo) ;Function to get cell reference "$combo" off the clipboard into variable $x winactivate("Microsoft Excel") ControlSend("Microsoft Excel","","XLDESK1","{f5}") While NOT ControlCommand ("Go To","","EDTBX1","IsVisible", "") ; wait for window sleep(100) Wend ControlSend("Go To","","EDTBX1",$combo &"{enter}") ControlSend("Microsoft Excel","","XLDESK1","^c"); copies contents $IP=clipget(); move clipboard to $x ControlSend("Microsoft Excel","","XLDESK1","{esc}"); return excel to normal state Return $IP EndFunc
  7. Hello, This is my first post.......Sorry its a long one...... I am at the end of the road here.... help PLEASE...Ok, Here is the issue. I have two peices of code that work on seperate .au3 files, but not when in the same script. I have been at this for hours, are bugs common? Purpose - of the code: Copy updated location infomation from an excel sheet to 2,600qty laser printers via their web interface. In my test code I have it set to repeat 10 times. Problem - my variable $IP does not seem to work correctly when the code is combined into one script. Specifically it does not add the string "/port_0/config/general" when I open the web interface. Very strange since it works correctly by itself. Example - When ran by its self it will open http://10.10.10.61"/port_0/config/general Which is what I want. When ran combined with the excel lookup it only returns http://10.10.10.61 sending me to the root not the configuration page as I wish. Script#1 #include <Process.au3> $1=1 $IP=InputBox ("input ip", "Here","") Do _RunDos("start http://"& $IP & "/port_0/config/general") ;To be called as from the START menu ;Wait for print server window to be activly loaded, then send the following; WinWaitActive("Print Server Settings - Microsoft Internet Explorer","") Sleep(1000) Send("{Tab}") Send("{Tab}") Send("123") Send("{Tab}") Send("{CTRLDOWN}a{CTRLUP}{BACKSPACE}") Send("location") Sleep(500) Send("{Enter}") WinWaitActive("Configuration Change Submitted - Microsoft Internet Explorer","") SoundPlay(@WindowsDir & "\media\tada.wav",1) Until $1 = 777 Script#2 ; Excel Cell reference lookup example ; This code is ran while an excel sheet is already open. $A = "A" $1 = 1 Do $combo = $A & $1 $x=getcell($combo) Send("{right}") ControlSend("Microsoft Excel","","XLDESK1","^c"); copies contents $y=clipget(); move clipboard to $y ControlSend("Microsoft Excel","","XLDESK1","{esc}"); return excel to normal state Send("{right}") ControlSend("Microsoft Excel","","XLDESK1","^c"); copies contents $z=clipget(); move clipboard to $z ControlSend("Microsoft Excel","","XLDESK1","{esc}"); return excel to normal state MsgBox(0,"output", $x & $y & $z) $1 = $1 + 1 Until $1 = 11 SoundPlay(@WindowsDir & "\media\tada.wav",1) Func getcell($combo) ;Function gets cell reference "$combo" off the clipboard into variable $x winactivate("Microsoft Excel") ControlSend("Microsoft Excel","","XLDESK1","{f5}") While NOT ControlCommand ("Go To","","EDTBX1","IsVisible", "") ; wait for window sleep(100) Wend ControlSend("Go To","","EDTBX1",$combo&"{enter}") ControlSend("Microsoft Excel","","XLDESK1","^c"); copies contents $x=clipget(); move clipboard to $x ControlSend("Microsoft Excel","","XLDESK1","{esc}"); return excel to normal state Return $x EndFunc Script-Combined as attachment Printer_ReName.au3
×
×
  • Create New...