jfcby
Active Members-
Posts
325 -
Joined
-
Last visited
About jfcby
- Birthday 08/14/1970
Profile Information
-
Member Title
Geek Problem Solver In The Making...
-
Location
USA
-
WWW
http://www.frankie-cooper.com
Recent Profile Visitors
1,112 profile views
jfcby's Achievements
Universalist (7/7)
3
Reputation
-
PoojaKrishna reacted to a post in a topic:
[Resolved] GUICtrlCreateInput Limit Characters
-
I'm using the following... AutoIt Version: v3.3.6.1 FF.au3 version: V0.6.0.1b-15 Firefox Version: 45.0.2 Excel Version: Microsoft Office Professional Plus 2013 My full script is reading text from a cell in an Excel file that has multiple lines of text. For example: Line 1 Line 2 Line 3 Each cell will vary in how many lines each has. Some will have 2 while others will have more. In order to provide a script that gives the same error that I'm getting run the following script. #include <FF.au3> ; trying to connect to a running FireFox with MozRepl on If _FFConnect(Default, Default, 3000) Then Local $ET, $ETLS ; open a page _FFOpenURL("http://frankiecooper.com/contact/") Sleep(3000) $ET1 = "Example Text Line 1" $ET2 = "Example Text Line 2" $ET3 = "Example Text Line 3" $ETLS = $ET1 & @LF $ETLS &= $ET2 & @LF $ETLS &= $ET3 MsgBox(0, "", $ETLS) _FFSetValue($ETLS , "fscf_field1_3", "id") ; ; disconnect from FireFox If _FFDisConnect() Then MsgBox(64, "", "Disconnected from FireFox!") Else MsgBox(64, "", "Can't connect to FireFox!") EndIf Thanks for your help.
-
I have a script that sends multiple lines of text to a textbox using Firefox. I using _FFSetValue($sCellValue[7], "line one" & @CR & "line two", "id") from ff.au3. If it's a single line of text it works but MozRepl give the following error with multiple lines of text. Error: __FFSend: try{FFau3.simulateEvent(window.content.top.document.getElementById('line one line two'),'Event','change',13);}catch(e){'_FFCmd_Err';}; __FFWaitForRepl ==> Error return value: MozRepl ....> __FFSend: ; __FFRecv: __FFSend: FFau3.WCD=window.content.top.document; __FFWaitForRepl ==> Error return value: MozRepl ....> __FFRecv: !!! SyntaxError: unterminated string literal Details: [object HTMLDocument] - {mainForm: {...}, location: {...}, getElementsByName: function() {...}, getItems: function() {...}, open: function() {...}, close: function() {...}, write: function() {...}, ...} !!! SyntaxError: unterminated string literal Will MozRepl plugin for Firefox send multiple lines of text to a textbox? Thanks for your help.
-
meows reacted to a post in a topic:
[RESOLVED] Inputbox update GUI after file selection
-
sisko59 reacted to a post in a topic:
Scite, tools/compile in x64 by default ?
-
I have a HTML table that I need to automatically get the number of rows and columns and get the value of each cell while looping through the table? An example would be row one would have two columns of data. I've tried the following code from the help file but it list all data in the table. #include <IE.au3> #include <Array.au3> ;Local $oIE = _IE_Example("table") Local $oIE = _IEAttach("Shop") Local $oTable = _IETableGetCollection($oIE, 14) Local $aTableData = _IETableWriteToArray($oTable, True) _ArrayDisplay($aTableData) I tried to modified it using the following code to display row one column one cell data and row one column two cell data to loop through the table but I'm getting a syntax error. #include <IE.au3> #include <Array.au3> Local $oIE = _IEAttach("Shop") $oTable = _IETableGetCollection($oIE, 14) Local $aTableData = _IETableWriteToArray($oTable, True) For $i = 0 To UBound($aTableData) - 1 MsgBox(1,1, $aTableData) ; & " - " & $aTableData[1]) ;<< get syntax error here Next I've read through and tried some scripts in the forum but none have worked. Thank you for your help, Frankie Cooper
-
PhoenixXL, Your solution worked great. Thanks for your help.
-
Hi, In my full script I've set it up to remember the program window position and saves it to an ini file so that when the program restarts it will be located in the user chosen position. But sometimes the window will get positioned outside of the desktop where it cannot be seen. Below is a test script where I compare the WinGetPos to the GetDesktopArea but it does not work properly. If the window is outside of the desktop at the bottom left or the top right then the script does recognize that. How can the script below be modified to keep the specified program window inside the desktop work area? I've search through this forum and did not find a solution. #include <WinAPI.au3> Global $DesktopArea = _GetDesktopArea() $winPos = WinGetPos("AutoIt Help") If $winPos[0] < $DesktopArea[0] or $winPos[1] < $DesktopArea[1] or _ $DesktopArea[2] > $winPos[1] or $DesktopArea[3] > $winPos[1] Then MsgBox(0, "Debug Test #1", "DesktopArea: " & $DesktopArea[0] & " " & $DesktopArea[1] & " " & $DesktopArea[2] & " " & $DesktopArea[3] & @CRLF & _ "winPos: " & $winPos[0] & " " & $winPos[1] & " " & $winPos[2] & " " & $winPos[3]) Else MsgBox(0, "Debug Test #2", "DesktopArea: " & $DesktopArea[0] & " " & $DesktopArea[1] & " " & $DesktopArea[2] & " " & $DesktopArea[3] & @CRLF & _ "winPos: " & $winPos[0] & " " & $winPos[1] & " " & $winPos[2] & " " & $winPos[3]) EndIf ; Get the working visible area of the desktop, this doesn't include the area covered by the taskbar. Func _GetDesktopArea() Local Const $SPI_GETWORKAREA = 48 Local $tWorkArea = DllStructCreate($tagRECT) _WinAPI_SystemParametersInfo($SPI_GETWORKAREA, 0, DllStructGetPtr($tWorkArea)) Local $aReturn[4] = [DllStructGetData($tWorkArea, "Left"), DllStructGetData($tWorkArea, "Top"), _ DllStructGetData($tWorkArea, "Right") - DllStructGetData($tWorkArea, "Left"), DllStructGetData($tWorkArea, "Bottom") - DllStructGetData($tWorkArea, "Top")] Return $aReturn EndFunc ;==>_GetDesktopArea Thanks for your help.
-
Edit Control and String Format Display Text Problem
jfcby replied to jfcby's topic in AutoIt General Help and Support
Thank you funkey and Melba23 for your help. Your replies solved solved my problem. Thank you. -
I have a edit control that I need to read text from an ini file and display formatted text. The problem is the edit control does not display the text with new lines (n) and tabs (t). How can I get the edit control to display the text from an ini file with new lines and tabs? I've searched through the help file and this forum but I did not find an answer. Ini File: db.ini ;Database Test Example [faqq] q0=Select a question q1=Question 1? q2=Question 2? q3=Question 3? [faqa] a0=Select a question above from the drop down.nnEach answer will be displayed here in this area.nnIf there are buttons below this text box then click them because there will be a video or a link for reference with more details.nnIf the answers you are looking for are not found here then go to the Help Tab for more details. a1=Answer 1. a2=Answer 2. a3=Answer 3nnAnswer 3anAnswer 3bt Answer 3ctAnswer 3dnAnswer 3et Answer 3ft Answer 3gnAnswer 3htt Answer 3it Answer 3j Script: #include <GUIConstantsEx.au3> #include <EditConstants.au3> #include <GuiEdit.au3> #include <WindowsConstants.au3> $IniLoc = @ScriptDir & "db.ini" GUICreate("Combo Ini Ex FAQ", 230, 200) $cbofaq = GUICtrlCreateCombo("", 10, 10, 200, 25) ; create first item $editfaq = GUICtrlCreateEdit("" & @CRLF, 10, 50, 200, 125, $ES_AUTOVSCROLL + $WS_VSCROLL) _FaqSetupCombo() GuiSetState() While 1 $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd Func _FaqSetupCombo() ; $irsfq = IniReadSection($IniLoc, "faqq") $irsfa = IniReadSection($IniLoc, "faqa") For $iirsfq = 1 To $irsfq [0][0] GUICtrlSetData($cbofaq, $irsfq[$iirsfq][1] & "|", IniRead($IniLoc, "faqq", "q0", "NotFound")) ; add other item and set a new default Next GUICtrlSetData($editfaq, StringFormat(IniRead($IniLoc, "faqa", "a0", "NotFound"))) ;Does not display text correct MsgBox(0, "", StringFormat(IniRead($IniLoc, "faqa", "a0", "NotFound"))) ;Displays text correct EndFunc ;==>_FaqSetupCombo Thank you for your help, jfcby
-
Read ini file check for number or character value
jfcby replied to jfcby's topic in AutoIt General Help and Support
Thank you guinness and Melba23 for your help. Works great. jfcby -
When reading an ini file how can you check if the value is a number or one of these characters `[]\;',./ I've tried IsNumber and StringRegExp($keySET1b, "[0-9]*") and neither of them worked. IsNumber populated message box two but should have populated message box one. StringRegExp populated message box one but should have populated message box two. #include <Array.au3> Global $keySet[5] Global $keySET1a = IniRead(@ScriptDir & "\IniHKSTestConfig2.ini", "Defaults", "hkswofa", "NotFound") ;"!" & "{" & "`" & "}") Global $keySET1b = IniRead(@ScriptDir & "\IniHKSTestConfig2.ini", "Defaults", "hkswofb", "NotFound") ;**** Test 1 **** If $keySET1a = "!" And IsNumber($keySET1b) Then ;StringRegExp($keySET1b, "[0-9]*") MsgBox(0, "", "Debug1: $keySET[1] Debug Test") ;<< StringRegExp populated this message box. $keySET[1] = $keySET1a & '{' & $keySET1b & '}' MsgBox (0, "Debug1 Value", $keySET[1]) ElseIf $keySET1a = "!" And Not IsNumber($keySET1b) Then ;StringRegExp($keySET1b,"[0-9]*") MsgBox(0, "", "Debug2: $keySET[2] Debug Test 2") ;<< IsNumber populated this message box. $keySET[2] = $keySET1a & '{' & $keySET1b & '}' MsgBox (0, "Debug2 Value", $keySET[2]) Else ;Testing Purposes & add more code if needed for future MsgBox(0, "HotKeySet Error Message", "No Hot Key is set!") EndIf HotKeySet($keySET[1], "_HKS1") HotKeySet($keySET[2], "_HKS2") While 1 Sleep(1000) WEnd Func _HKS1() MsgBox(0, "Debug1", "HotKetSet 1") EndFunc Func _HKS2() MsgBox(0, "Debug2", "HotKetSet 2") EndFunc INI File: [Defaults] hkswofa=! hkswofb=1 Thank you for your help.
-
Where do I place this in my script? I've tried it in two different places and they did not work. First try was like in the variable $keyA: Local $keySETa = iniread(@ScriptDir & "\IniHKSTestConfig.ini", "Defaults", "hkswofa", "NotFound") Local $keySETb = iniread(@ScriptDir & "\IniHKSTestConfig.ini", "Defaults", "hkswofb", "NotFound") Local $keySET = '"' & $keySETa & '{' & $keySETb & '}"' msgbox (0, "ok", $keySET);test to see what is sent $keyA = Execute( 'HotKeySet($keySET, "_F6_Func")') While 1 Sleep(1000) WEnd Func _F6_Func() MsgBox(0, "", "") EndFunc The second try was below the $keyA variable: Local $keySETa = iniread(@ScriptDir & "\IniHKSTestConfig.ini", "Defaults", "hkswofa", "NotFound") Local $keySETb = iniread(@ScriptDir & "\IniHKSTestConfig.ini", "Defaults", "hkswofb", "NotFound") Local $keySET = '"' & $keySETa & '{' & $keySETb & '}"' msgbox (0, "ok", $keySET);test to see what is sent $keyA = HotKeySet($keySET, "_F6_Func") Execute( 'HotKeySet($keySET, "_F6_Func")') While 1 Sleep(1000) WEnd Func _F6_Func() MsgBox(0, "", "") EndFunc Thank you for your help, jfcby
-
I apologize for posting this in the wrong forum would someone move it to the correct one for me. Thank you for your help. I'm trying to use HotKeySet with a variable so that I can set them using an ini file. I've search this forum and found this post but I could not get it to work with the changes I made to it. My ini file: [Defaults] hkswofa=! hkswofb=[ My AutoIt Script: Local $keySETa = iniread(@ScriptDir & "\IniHKSTestConfig.ini", "Defaults", "hkswofa", "NotFound") Local $keySETb = iniread(@ScriptDir & "\IniHKSTestConfig.ini", "Defaults", "hkswofb", "NotFound") Local $keySET = '"' & $keySETa & '{' & $keySETb & '}"' msgbox (0, "ok", $keySET);test to see what is sent $keyA = HotKeySet($keySET, "_F6_Func") While 1 Sleep(1000) WEnd Func _F6_Func() MsgBox(0, "", "") EndFunc The message box displays the correct code but when I test the key combination the function message box does not popup. How can I set a hot key using a variable that is read from an ini file? Thank you for your help, jfcby
-
I do not understand how to do this because I thought I was checking state of the GUI here: If Not WinActive($aGuiTitle) Then $wState = True ;Turn On ElseIf WinActive($aGuiTitle) Then $wState = False ;Turn Off EndIf and then in the function _GuiShowHide(). Here is the full script: #include <WindowsConstants.au3> #include <WinAPI.au3> #include <IE.au3> ;Opt("WinTitleMatchMode", 4) ;1=start, 2=subStr, 3=exact, 4=advanced, -1 to -4=Nocase Global $mGuiTitle, $aGuiTitle, $wState = "" $mGuiTitle = "Main GUI Title" ; Main GUI Title $aGuiTitle = "Google - Windows Internet Explorer" ; Attach GUI Title If Not WinActive($aGuiTitle) Then $wState = True ;Turn On ElseIf WinActive($aGuiTitle) Then $wState = False ;Turn Off EndIf ; Create Main GUI $mGUI = GUICreate($mGuiTitle, 200, 37, 150, 150, $WS_POPUP) GUISetState(@SW_HIDE) AdlibEnable("_GuiShowHide") While 1 Sleep(10) $hMsg = GUIGetMsg() If $hMsg = -3 Then Exit WEnd Func _GuiShowHide() ; Attach GUI window when ; 1. is active then shows the Main GUI ; 2. is not active then hides the Main GUI ; Attach to a browser with URL $oIE = _IEAttach ("http://www.google.com/", "URL") If @error = $_IEStatus_NoMatch Then MsgBox(0, "Debug", "$_IEStatus_NoMatch") ElseIf @error = $_IEStatus_InvalidValue Then MsgBox(0, "Debug", "$_IEStatus_InvalidValue") ElseIf @error = $_IEStatus_Success Then ;MsgBox(0, "Debug", "$_IEStatus_Success") If Not WinActive($aGuiTitle) Then WinSetState($mGUI, "", @SW_HIDE) ;MsgBox(0, "Debug", "Win State Off") $wState = True ;Turn On ElseIf WinActive($aGuiTitle) Then If $wState = True Then ; Set Main GUI window as parent ;_WinAPI_SetParent($mGUI, $aGui) WinSetOnTop($mGUI, "", 1) WinSetState($mGUI, "", @SW_SHOW) ;MsgBox(0, "Debug", "Win State On") $wState = False ;Turn Off EndIf EndIf EndIf EndFunc ;==>_GuiAttach Thank you for your help, jfcby
-
I think I've made the changes that was suggested above but when the IE Google window is active my GUI is continuously flashing. How can the GUI flashing be fixed? #include <WindowsConstants.au3> #include <WinAPI.au3> #include <IE.au3> ;Opt("WinTitleMatchMode", 4) ;1=start, 2=subStr, 3=exact, 4=advanced, -1 to -4=Nocase Global $mGuiTitle, $aGuiTitle, $wState = "" $mGuiTitle = "Main GUI Title" ; Main GUI Title $aGuiTitle = "Google - Windows Internet Explorer" ; Attach GUI Title If Not WinActive($aGuiTitle) Then $wState = True ;Turn On ElseIf WinActive($aGuiTitle) Then $wState = False ;Turn Off EndIf ; Create Main GUI $mGUI = GUICreate($mGuiTitle, 200, 37, 150, 150, $WS_POPUP) GUISetState(@SW_HIDE) AdlibEnable("_GuiShowHide") While 1 Sleep(10) $hMsg = GUIGetMsg() If $hMsg = -3 Then Exit WEnd Func _GuiShowHide() ; Attach GUI window when ; 1. is active then shows the Main GUI ; 2. is not active then hides the Main GUI ; Attach to a browser with URL $oIE = _IEAttach ("http://www.google.com/", "URL") If @error = $_IEStatus_NoMatch Then MsgBox(0, "Debug", "$_IEStatus_NoMatch") ElseIf @error = $_IEStatus_InvalidValue Then MsgBox(0, "Debug", "$_IEStatus_InvalidValue") ElseIf @error = $_IEStatus_Success Then ;MsgBox(0, "Debug", "$_IEStatus_Success") If Not WinActive($aGuiTitle) Then WinSetState($mGUI, "", @SW_HIDE) ;MsgBox(0, "Debug", "Win State Off") $wState = True ;Turn On ElseIf WinActive($aGuiTitle) Then If $wState = True Then ; Set Main GUI window as parent ;_WinAPI_SetParent($mGUI, $aGui) WinSetOnTop($mGUI, "", 1) WinSetState($mGUI, "", @SW_SHOW) ;MsgBox(0, "Debug", "Win State On") $wState = False ;Turn Off EndIf EndIf EndIf EndFunc ;==>_GuiAttach Thank you for your help, jfcby
-
I'm continuing to work on the script. If I close the IE that is associated with the Google window then the GUI will not respond. How can I get the GUI to respond to the IE Google window after IE has been closed and reopened? #include <WindowsConstants.au3> #include <WinAPI.au3> Opt("WinTitleMatchMode", 4) ;1=start, 2=subStr, 3=exact, 4=advanced, -1 to -4=Nocase Global $mGuiTitle, $aGuiTitle, $wState = "" $mGuiTitle = "Main GUI Title" ; Main GUI Title $aGuiTitle = "Google - Windows Internet Explorer" ; Attach GUI Title ; Getting the Handle to the window I want to attach my toolbar to $aGui = WinGetHandle($aGuiTitle) If Not WinActive($aGuiTitle) Then $wState = True ;Turn On ElseIf WinActive($aGuiTitle) Then $wState = False ;Turn Off EndIf ; Create Main GUI $mGUI = GUICreate($mGuiTitle, 200, 37, 150, 150, $WS_POPUP) GUISetState(@SW_HIDE) AdlibEnable("_GuiShowHide") While 1 Sleep(10) $hMsg = GUIGetMsg() If $hMsg = -3 Then Exit WEnd Func _GuiShowHide() ; When attach GUI window ; 1. is active then shows the Main GUI ; 2. is not active then hides the Main GUI $aGui = WinGetHandle("") $aGui = WinGetHandle($aGuiTitle) If Not WinActive($aGuiTitle) Then WinSetState($mGUI, "", @SW_HIDE) $wState = True ;Turn On ElseIf WinActive($aGuiTitle) Then If $wState = True Then ; Set Main GUI window as parent _WinAPI_SetParent($mGUI, $aGui) WinSetState($mGUI, "", @SW_SHOW) $wState = False ;Turn Off EndIf EndIf EndFunc ;==>_GuiAttach Thanks for your help, jfcby
-
Hi, I'm trying to figure out how to attach my GUICreate() to the IE Google window. To be more specific I need my GUICreate to show when the Google webpage window is active in IE and then hide when the Google webpage window is inactive. The script below continuously flashes when the Google webpage window is active. How can I get the following script to show the GUICreate only when the Google webpage window is active without continuously flashing and then hide when it is inactive? #include <WindowsConstants.au3> #include <WinAPI.au3> $mGuiTitle = "Main GUI Title" ; Main GUI Title $aGuiTitle = "Google" ; Attach GUI Title ; Create Main GUI $mGUI = GUICreate($mGuiTitle, 200, 37, 150, 150, $WS_POPUP) ; Set Main GUI window as parent _WinAPI_SetParent($mGUI, $aGuiTitle) GUISetState(@SW_HIDE) WinSetOnTop($mGuiTitle, "", 1) While 1 Sleep(10) $hMsg = GUIGetMsg() If $hMsg = -3 Then Exit _GuiShowHide() WEnd Func _GuiShowHide() ; When attach GUI window ; 1. is active then shows the Main GUI ; 2. is not active then hides the Main GUI While WinActive($aGuiTitle) WinSetState($mGuiTitle, "", @SW_SHOW) WinWaitNotActive($aGuiTitle) WinSetState($mGuiTitle, "", @SW_HIDE) WEnd EndFunc ;==>_GuiAttach Thank you for your help, jfcby