ABDULLAH701 Posted March 26, 2012 Posted March 26, 2012 Hello Everybody I am new to AutoIt I just practiced it few days ago I want to write script that change periodicity for metastock applicatio I did most of the script I go to menu then F&rmat Then &X-Axis... As follow WinWaitActive("[CLASS:MetaStockMainWnd]", "") WinMenuSelectItem("[CLASS:MetaStockMainWnd]", "", "F&ormat", "&X-Axis..." ) Sleep(500) Then a window comes out with tab control of four tabs Scale Periodicity Margins Grid and I want to choose periodicity how can I press Periodicity tab any help please
DelStone Posted March 26, 2012 Posted March 26, 2012 You may want to look at which addresses a similar request...
ABDULLAH701 Posted March 26, 2012 Author Posted March 26, 2012 I did not created GUI the tab control is part of pupolar application (metastock)
DelStone Posted March 27, 2012 Posted March 27, 2012 The link I gave you is trying to click a tab that has not been created in their own app but in outlook: "I'm making a program to automate account creation in outlook 2k3. I get all the fields entered with text, click the "More Settings" button, but I cannot click an individual tab. I want to click the "Outgoing mail server" tab and check "My server requires authentication" is there a way to do this without using send keys, and click by coordinates?"
GPinzone Posted March 27, 2012 Posted March 27, 2012 I'm not sure that I understand the problem. I assume it's an issue due to the controls appearing after a certain time that's not completely predictable. I had a similar situation where selecting an item in one drop down causes new ones to appear on the screen. Rather than "sleeping" to wait for the new controls to appear, I used this: ; Wait for field to appear. Do ControlGetHandle("Title", "", "[NAME:Handle]") Until @error <> 1 Gerard J. Pinzonegpinzone AT yahoo.com
ABDULLAH701 Posted March 27, 2012 Author Posted March 27, 2012 Thank you GPinZone for replying and thank DelstoneI got the following script from the linke provided above it activate system propertis window and press the tab advanced; This must be run with Beta 3.2.13.1 or later to have _GuiCtrlTab_ClickTab()#include <GuiTab.au3>; Open system propertiesDim $sTitle = "System Properties"Send("#{Pause}")WinWait($sTitle, "", 10)$hWnd = WinGetHandle($sTitle)If @error Then _Exitonerror("Failed to open System Properties window.")WinActivate($hWnd)Sleep(2000); Get handle to Tab control$hTab = ControlGetHandle($hWnd, "", "SysTabControl321")If @error Then _Exitonerror("Failed to get handle to TAB control."); Find and select Advanced tab$iAdvTab = _GUICtrlTab_FindTab($hTab, "Advanced")If $iAdvTab = -1 Then _Exitonerror("Failed to find 'Advanced' tab.")_GUICtrlTab_ClickTab($hTab, $iAdvTab)If _GUICtrlTab_GetCurSel($hTab) <> $iAdvTab Then _Exitonerror("Failed to change selected tab to 'Advanced'.")Sleep(2000); Click on Error Reporting buttonControlClick($hWnd, "", "[CLASS:Button; INSTANCE:8]"); Error Reporting; Wait for Error Reporting dialog and click 'Cancel'WinWait("Error Reporting", "", 10)Sleep(2000)ControlClick("Error Reporting", "", "[CLASS:Button; INSTANCE:8]"); CANCELSleep(2000); Close System PropertiesWinClose($hWnd)Func _Exitonerror($sText) MsgBox(16, "Error", $sText) ExitEndFuncthe problem here is even if you change the name of the window Dim ($sTitle = "System Properties")for another window say Dim $sTitle = "X-Axis Properties"and change$iAdvTab = _GUICtrlTab_FindTab($hTab, "Advanced") to$iAdvTab = _GUICtrlTab_FindTab($hTab, "Periodicity")when i run the script the system properties window open i dont know whyyou can try it your self if you have an explanation please let me knowthank you very much
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