JavaAutomater
Active Members-
Posts
21 -
Joined
-
Last visited
JavaAutomater's Achievements
Seeker (1/7)
0
Reputation
-
I have two questions to do with _ArrayDisplay
JavaAutomater replied to JavaAutomater's topic in AutoIt GUI Help and Support
I had a quick look at _ArrayDisplay code and see that if you don't specify the $sSeparator value, it init's it to "|" That is why my code was "not working" Thanks for the help! I need to pass the $sSeparator value to what I was trying to set via 'GUIDataSeparatorChar' -
I have two questions to do with _ArrayDisplay : 1. I am having a proper displaying pipe separated strings using _ArrayDisplay. Regardless of the value I assign to GUIDataSeparatorChar, _ArrayDisplay does not show strings that are pipe separated? ( GUIDataSeparatorChar : Define the character which delimits subitems in GUICtrlSetData. The default character is '|'. ) Here is the example: #include <Array.au3> Local $avArray[10] $avArray[0] = "JPM | A" $avArray[1] = "Holger | A" $avArray[2] = "Jon | A" $avArray[3] = "Larry | A" $avArray[4] = "Jeremy | A" $avArray[5] = "Valik | A" $avArray[6] = "Cyberslug | A" $avArray[7] = "Nutster | A" $avArray[8] = "JdeB | A" $avArray[9] = "Tylo | A" _ArrayDisplay($avArray, "$avArray set manually 1D") _ArrayDisplay($avArray, "$avArray set manually 1D transposed", -1, 1) AutoItSetOption( "GUIDataSeparatorChar", '=' ) _ArrayDisplay($avArray, "$avArray set manually 1D") _ArrayDisplay($avArray, "$avArray set manually 1D transposed", -1, 1) AutoItSetOption( "GUIDataSeparatorChar", Default ) Here is the output: [0]|JPM | A [1]|Holger | A [2]|Jon | A [3]|Larry | A [4]|Jeremy | A [5]|Valik | A [6]|Cyberslug | A [7]|Nutster | A [8]|JdeB | A [9]|Tylo | A [0]|JPM | A|Holger | A|Jon | A|Larry | A|Jeremy | A|Valik | A|Cyberslug | A|Nutster | A|JdeB | A|Tylo | A [0]|JPM | A [1]|Holger | A [2]|Jon | A [3]|Larry | A [4]|Jeremy | A [5]|Valik | A [6]|Cyberslug | A [7]|Nutster | A [8]|JdeB | A [9]|Tylo | A [0]|JPM | A|Holger | A|Jon | A|Larry | A|Jeremy | A|Valik | A|Cyberslug | A|Nutster | A|JdeB | A|Tylo | A As you can see, regardless of the AutoItSetOption( "GUIDataSeparatorChar", '=' ) usage, the output does not differ! Any help? 2. could I use something like this AutoItSetOption( "GUIDataSeparatorChar", Chr( 1 ) ) ( note the Chr( 1 ) which is a non printable character ) so that it does not supress output of any printable character?
-
In the _ArrayDisplay function, will it be possible to highlight a certain column(s) ( say in a different background color or font size/name/color etc? ) I believe it could be done by opening the Array.au3 file and modifying the function, but I don't want to touch the stock includes, nor duplicate the whole function with only the little change. Is there any way I can use the stock _ArrayDisplay function, and, for example, maybe get a handler to the listview and do the modifications myself?
-
This does not seem to work - script should bring up the AutoIt button menu, but does not. Instead, it clicks on start button ( this happens VERY fast and you will not notice it unless you record the screen and play it back in slow motion ) Here is the test script: #include "_SysTray.au3" #include <Process.au3> AutoItSetOption("MustDeclareVars", 1) ;Opt("TrayIconDebug", 1) ; shows the current script line in the tray icon tip to help debugging. We CANNOT use this in this script as we need the tooltip to stay constant Local $msgBoxTitle = "JA"; Local $count = _SysTrayIconCount() ConsoleWrite("Count visible tray: " & $count & @CRLF) Local $i = 0; For $i = $count - 1 To 0 Step -1 Local $handle = _SysTrayIconHandle( $i ) Local $visible = _SysTrayIconVisible( $i ) Local $pid = WinGetProcess( $handle ) Local $name = _ProcessGetName( $pid ) Local $title = WinGetTitle( $handle ) Local $tooltip = _SysTrayIconTooltip( $i ) If ("AutoIt3.exe" == $name) And ( "AutoIt v3" == $title ) Then ConsoleWrite("index: " & $i & @TAB & "visible: " & $visible & @TAB & "handle: " & $handle & @TAB & "pid: " & $pid & @TAB & "proc: " & $name & @TAB & @TAB & "title: " & $title & @TAB & @TAB & "tooltip: " & $tooltip & @CRLF) ; found the thing we are to close! TrayTip( $msgBoxTitle, "Located program successfully with tooltip '" & $tooltip & "'", 17, 1 ) Sleep( 10000 ) ;If 1 <> _SysTray_ClickItem_( $tooltip, "left", 2 ) Then If 1 <> _SysTray_ClickItem_( $tooltip, "left", 1 ) Then ; Should bring up the button menu, but does not. Instead, it clicks on start button ( this happens VERY fast and you will not notice it unless you record the screen and play it back in slow motion ) TrayTip( $msgBoxTitle, "Left click on button Failed!", 17, 2 ) MsgBox(0, $msgBoxTitle, "Left click on button Failed!" ) Exit Else TrayTip( $msgBoxTitle, "Left click on button succeeded!", 17, 2 ) MsgBox(0, $msgBoxTitle, "Left click on button succeeded!" ) EndIf EndIf ;ConsoleWrite( @OSVersion ); ;ConsoleWrite("index: " & $i & @TAB & "visible: " & $visible & @TAB & "handle: " & $handle & @TAB & "pid: " & $pid & @TAB & "proc: " & $name & @TAB & @TAB & "title: " & $title & @TAB & @TAB & "tooltip: " & $tooltip & @CRLF) Next Sleep( 10000 ) #include <GuiToolBar.au3> ;http://www.autoitscript.com/forum/index.php?showtopic=63397 ;=========# _SysTray_ClickItem #====================================================== ; ;Function Name: _SysTray_ClickItem() ;Description: Click on item in Windows system tray by any substring in the title ;Parameters: $iTitle - The title of the item in Windows system tray (you can see the title of the item when mouse cursor hovered on item). ; $iButton - [optional] The button to click, "left" or "right". Default is the left button. ; $iClick - [optional] The number of times to click the mouse. Default is 1 ; $sMove = [optional] True = Mouse will be moved, False (default) = Mouse will not be moved ; $iSpeed = [optional] Mouse movement speed ;Return Value(s): Success - Returns 1 ; Failure - Returns 0 and sets @error to 1 if required item not found ;Requirement(s): AutoIt 3.2.10.0 and above ;Autor(s): R.Gilman (a.k.a rasim); Siao (Thanks for idea) ; ;==================================================================================== Func _SysTray_ClickItem_($iTitle, $iButton = "left", $iClick = 1, $sMove = False, $iSpeed = 1) Local $i Local $hToolbar = ControlGetHandle("[Class:Shell_TrayWnd]", "", "[Class:ToolbarWindow32;Instance:1]") If @error Then Return SetError(1, 0, 0) EndIf Local $iButCount = _GUICtrlToolbar_ButtonCount($hToolbar) If $iButCount = 0 Then Return SetError(1, 0, 0) EndIf ; FIXME : Why are we doing this? Local $hButton = ControlGetHandle( "[Class:Shell_TrayWnd]", "", "Button1" ) If $hButton <> "" Then ControlClick( "[Class:Shell_TrayWnd]", "", "Button1" ) Local $ToolTips = ""; For $i = 0 To $iButCount - 1 Local $cID = _GUICtrlToolbar_IndexToCommand($hToolBar, $i) ;$ToolTips &= _GUICtrlToolbar_GetButtonText($hToolBar, $cID) & @LF; $ToolTips &= _GUICtrlToolbar_GetButtonText($hToolBar, $cID) & "|"; If 0 <> StringInStr( _GUICtrlToolbar_GetButtonText( $hToolBar, $cID ), $iTitle ) Then _GUICtrlToolbar_ClickButton( $hToolbar, $cID, $iButton, $sMove, $iClick, $iSpeed ) ConsoleWrite( "Was looking for ( and found ) '" & $iTitle & "' in list : " & $ToolTips & @CRLF ) Return 1 EndIf Next ConsoleWrite( "Was looking for ( but not got ) '" & $iTitle & "' in list : " & $ToolTips & @CRLF ) MsgBox(0, $iTitle, $ToolTips ); Return SetError(1, 0, 0) EndFunc
-
I still have a problem. After locating the icon, I want to right click on it ( to get the menu ) and se;ect an option in that menu. Right now, I cannot get to spawn the menu at all using the following code "that should work": #include "_SysTray.au3" #include <Process.au3> AutoItSetOption("MustDeclareVars", 1) Opt("TrayIconDebug", 1) ; shows the current script line in the tray icon tip to help debugging Local $msgBoxTitle = "JA"; Local $count = _SysTrayIconCount() ConsoleWrite("Count visible tray: " & $count & @CRLF) Local $i = 0; For $i = $count - 1 To 0 Step -1 Local $handle = _SysTrayIconHandle( $i ) Local $visible = _SysTrayIconVisible( $i ) Local $pid = WinGetProcess( $handle ) Local $name = _ProcessGetName( $pid ) Local $title = WinGetTitle( $handle ) Local $tooltip = _SysTrayIconTooltip( $i ) If ("AutoIt3.exe" == $name) And ( $title == "AutoIt v3" ) Then ConsoleWrite("index: " & $i & @TAB & "visible: " & $visible & @TAB & "handle: " & $handle & @TAB & "pid: " & $pid & @TAB & "proc: " & $name & @TAB & @TAB & "title: " & $title & @TAB & @TAB & "tooltip: " & $tooltip & @CRLF) ; found the thing we are to close! TrayTip( $msgBoxTitle, "Located program successfully with tooltip '" & $tooltip & "'", 17, 1 ) Sleep( 3500 ) If 0 == ControlClick( "", "", $handle, "menu" ) Then ;If 0 == ControlClick( "", "", $handle, "left", 1 ) Then ;If 0 == WinMenuSelectItem( $handle, "", "" ) Then TrayTip( $msgBoxTitle, "Right click on button Failed!", 17, 2 ) MsgBox(0, $msgBoxTitle, "Right click on button Failed!", 5) Sleep( 500 ) Exit EndIf EndIf ;ConsoleWrite( @OSVersion ); ;ConsoleWrite("index: " & $i & @TAB & "visible: " & $visible & @TAB & "handle: " & $handle & @TAB & "pid: " & $pid & @TAB & "proc: " & $name & @TAB & @TAB & "title: " & $title & @TAB & @TAB & "tooltip: " & $tooltip & @CRLF) Next Sleep( 10000 ) The code sucessfully detects the icon, but cannot supposedly right/left click on it ?!
-
KaFu, It now works with a little patch: http://www.autoitscript.com/forum/index.php?showtopic=105650&view=findpost&p=746750
-
Discovering new mail event in Outlook
JavaAutomater replied to JavaAutomater's topic in AutoIt General Help and Support
Juvigy, I have already tried out that script, in fact here is a post I made that will show I have written code experimenting with the Outlook UDF: http://www.autoitscript.com/forum/index.php?showtopic=89321&view=findpost&p=746737 I want to know how I can catch new mail events from AutoIt. Has anyone does this before? -
Discovering new mail event in Outlook
JavaAutomater replied to JavaAutomater's topic in AutoIt General Help and Support
Stefan, Right now I am doing this with ruleset, however, I need some more advanced behaviour that would require very complex rulesets. Thus, I would prefer to code the complex behaviour in, say AutoIt, and trigger the script from a simple rulset. HTC/etc can be paged by sending an SMS/email to a specific address, but that is not the main goal. The main goal is classification of the mail and acting on some information embedded in the mailbody. -
Hmmm.. thanks for the feedback. Can you confirm if you have the SeDebugPrivilige ? I believe this is required for the functions to succeed. Can the author(s) of this script please have a look into this?