NickolasC Posted February 12, 2010 Posted February 12, 2010 Hello!I have found the previous posts on this forum and I am successfuly running the example utilizing this method:If StringInStr(_GUICtrlToolbar_GetButtonText($hSysTray_Handle, $iSystray_ButtonNumber), $sToolTipTitle) = 1This is an icon that turns on/off a service. The first time I run the script, it successfully turns the service on. But when I revert the service and try for the second time, the scrpit can't find the control anymore. This happens for every consecutive try. It only works when it runs after the first login to the OS. The text of the tooltip is still there when I mouseover, but when I loop trough the icons and have a look at the retrieved names with a Msgbox popup, I see the name of the icon as NULL/empty. The tragetting utility shows the control and its contents, and the name is there, but the script is unable to get it right. Can you think of what can be causing this behaviour? Is it possible to target the control by the executable file name rather than browsing the tooltips? Thanks!
Moderators Melba23 Posted February 13, 2010 Moderators Posted February 13, 2010 NickolasC,Welcome to the AutoIt forum. That code looks familiar..... You might want to try altering the code slightly to this (someone pointed out the other day that is was a bit restrictive as it was):If StringInStr(_GUICtrlToolbar_GetButtonText($hSysTray_Handle, $iSystray_ButtonNumber), $sToolTipTitle) <> 0What service are you trying to automate? Are you sure the text is identical in both cases?M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
NickolasC Posted February 23, 2010 Author Posted February 23, 2010 I am trying to automate connecting EasySet, a Samsung Telecom software, the text is "Let's connect system". When it is connected, the text does change, but when I disconnect it is again set to the same initial Text. But as I said, I loop trough the icons to MsgBox the text of each, and the value is null. It works by logging out/in of windows, but only once. It feels like the text is updated but wherever AutoIT gets the value from has the text registered as Null even tough it is visible on mouseover. I did double check that it is the same text. It toggles between "Let's connect system" and "Connected". Is it the single quote messing things up again? : )
Moderators Melba23 Posted February 23, 2010 Moderators Posted February 23, 2010 NickolasC,If you can get a value for $iSystray_ButtonNumber once, it should remain valid until the system reboots as any subsequent tray icons will take the next number in the queue - unless you start closing icons ahead of course. So perhaps if you set up a variable to retain the value you obtain on the first call, you might be able to continue to access the icon despite its (seeming) lack of tooltip text.Sorry I cannot be of more help - I have never met an icon with a tooltip that the script cannot read before. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now