Что нового

UIAutomate Google Chrome и"Автоматические субтитры"

1dark1

Новичок
Сообщения
16
Репутация
0
Привет помогите понять

Как с помощью UIAutomate передать "Автоматические субтитры" созданые Google Chrome в переменную

(текст не копируется и не выделяется)

текст который нужен находить в
Код:
 UIA_text:= ,UIA_title:=,UIA_Name:=,UIA_LegacyIAccessibleName:=
(дублируется) и он меняется со временем а
Код:
 UIA_LegacyIAccessibleDescription:= <Автоматические субтитры>
не меняется

simplespy показывает следующие (код активирует элемент и кликает по нему)

Код:
    https://www.autoitscript.com/forum/topic/153520-iuiautomation-ms-framework-automate-chrome-ff-ie/?do=findComment&comment=1156373 
At least we have an element title: [back and then put it back in the frame because he wants to do this long, and where his child throws up take the picture out of the frame I didn't know where you're going] class: []

Having the following values for all properties: 
Title is: <back and then put it back in the frame because he wants to do this long, and where his child throws up take the picture out of the frame I didn't know where you're going>    Class   := <>    controltype:= <UIA_EditControlTypeId>    ,<50004>    , (0000C354)    2061;1161;543;438
*** Parent Information top down ***
3: Title is: <Bethesda - Twitch: воспроизводится аудио – Google Chrome Canary>    Class   := <Chrome_WidgetWin_1>    controltype:= <UIA_PaneControlTypeId>    ,<50033>    , (0000C371)    -7;16;2672;1630
"Title:=Bethesda - Twitch: воспроизводится аудио – Google Chrome Canary;controltype:=UIA_PaneControlTypeId;class:=Chrome_WidgetWin_1""    
2: Title is: <>    Class   := <Chrome_WidgetWin_1>    controltype:= <UIA_PaneControlTypeId>    ,<50033>    , (0000C371)    2049;1151;568;463
"Title:=;controltype:=UIA_PaneControlTypeId;class:=Chrome_WidgetWin_1""    
1: Title is: <>    Class   := <>    controltype:= <UIA_PaneControlTypeId>    ,<50033>    , (0000C371)    2048;1150;569;464
"Title:=;controltype:=UIA_PaneControlTypeId;class:=""    
0: Title is: <>    Class   := <>    controltype:= <UIA_PaneControlTypeId>    ,<50033>    , (0000C371)    2055;1155;555;450
"Title:=;controltype:=UIA_PaneControlTypeId;class:=""    

;~ *** Standard code maintainable ***
#include "UIAWrappers.au3"
AutoItSetOption("MustDeclareVars", 1)

_UIA_setVar("oP1","Title:=Bethesda - Twitch: воспроизводится аудио – Google Chrome Canary;controltype:=UIA_PaneControlTypeId;class:=Chrome_WidgetWin_1")    ;Bethesda - Twitch: воспроизводится аудио – Google Chrome Canary
_UIA_setVar("oP2","Title:=;controltype:=UIA_PaneControlTypeId;class:=Chrome_WidgetWin_1")    ;
_UIA_setVar("oP3","Title:=;controltype:=UIA_PaneControlTypeId;class:=")    ;
_UIA_setVar("oP4","Title:=;controltype:=UIA_PaneControlTypeId;class:=")    ;

;~ $oUIElement=_UIA_getObjectByFindAll("backandthenputitbackintheframebecausehewantstodothislong,andwherehischildthrowsuptakethepictureoutoftheframeIdidn'tknowwhereyou'regoing.mainwindow", "title:=back and then put it back in the frame because he wants to do this long, and where his child throws up take the picture out of the frame I didn't know where you're going;ControlType:=UIA_EditControlTypeId", $treescope_subtree)
_UIA_setVar("oUIElement","Title:=back and then put it back in the frame because he wants to do this long, and where his child throws up take the picture out of the frame I didn't know where you're going;controltype:=UIA_EditControlTypeId;class:=") ;ControlType:=UIA_EditControlTypeId;classname:=")

;~ Actions split away from logical/technical definition above can come from configfiles 

;~_UIA_Action("oP1","highlight")
_UIA_Action("oP1","setfocus")
;~_UIA_Action("oP2","highlight")
_UIA_Action("oP2","setfocus")
;~_UIA_Action("oP3","highlight")
_UIA_Action("oP3","setfocus")
;~_UIA_Action("oP4","highlight")
_UIA_Action("oP4","setfocus")

_UIA_action("oUIElement","highlight")
;~_UIA_action("oUIElement","click")

;~ *** Standard code Flexible***
#include "UIAWrappers.au3"
AutoItSetOption("MustDeclareVars", 1)

Local $oP3=_UIA_getObjectByFindAll($UIA_oDesktop, "Title:=Bethesda - Twitch: воспроизводится аудио – Google Chrome Canary;controltype:=UIA_PaneControlTypeId;class:=Chrome_WidgetWin_1", $treescope_children)    
_UIA_Action($oP3,"setfocus")
Local $oP2=_UIA_getObjectByFindAll($oP3, "Title:=;controltype:=UIA_PaneControlTypeId;class:=Chrome_WidgetWin_1", $treescope_children)    
_UIA_Action($oP2,"setfocus")
Local $oP1=_UIA_getObjectByFindAll($oP2, "Title:=;controltype:=UIA_PaneControlTypeId;class:=", $treescope_children)    
Local $oP0=_UIA_getObjectByFindAll($oP1, "Title:=;controltype:=UIA_PaneControlTypeId;class:=", $treescope_children)    
;~ First find the object in the parent before you can do something
;~$oUIElement=_UIA_getObjectByFindAll("backandthenputitbackintheframebecausehewantstodothislong,andwherehischildthrowsuptakethepictureoutoftheframeIdidn'tknowwhereyou'regoing.mainwindow", "title:=back and then put it back in the frame because he wants to do this long, and where his child throws up take the picture out of the frame I didn't know where you're going;ControlType:=UIA_EditControlTypeId", $treescope_subtree)
Local $oUIElement=_UIA_getObjectByFindAll($oP0, "title:=back and then put it back in the frame because he wants to do this long, and where his child throws up take the picture out of the frame I didn't know where you're going;ControlType:=UIA_EditControlTypeId", $treescope_subtree)
;~_UIA_action($oUIElement,"highlight")
_UIA_action($oUIElement,"click")

*** Detailed properties of the highlighted element ***
UIA_title:= <back and then put it back in the frame because he wants to do this long, and where his child throws up take the picture out of the frame I didn't know where you're going>
UIA_text:= <back and then put it back in the frame because he wants to do this long, and where his child throws up take the picture out of the frame I didn't know where you're going>
UIA_regexptitle:= <back and then put it back in the frame because he wants to do this long, and where his child throws up take the picture out of the frame I didn't know where you're going>
UIA_iaccessiblechildId:= <0>
UIA_handle:= <0>
UIA_BoundingRectangle:= <2061;1161;543;438>
UIA_ProcessId:= <69364>
UIA_ControlType:= <50004>
UIA_LocalizedControlType:= <поле>
UIA_Name:= <back and then put it back in the frame because he wants to do this long, and where his child throws up take the picture out of the frame I didn't know where you're going>
UIA_HasKeyboardFocus:= <True>
UIA_IsKeyboardFocusable:= <True>
UIA_IsEnabled:= <True>
UIA_Culture:= <0>
UIA_IsControlElement:= <True>
UIA_IsContentElement:= <True>
UIA_IsPassword:= <False>
UIA_NativeWindowHandle:= <0>
UIA_IsOffscreen:= <False>
UIA_Orientation:= <0>
UIA_IsRequiredForForm:= <False>
UIA_IsDockPatternAvailable:= <False>
UIA_IsExpandCollapsePatternAvailable:= <False>
UIA_IsGridItemPatternAvailable:= <False>
UIA_IsGridPatternAvailable:= <False>
UIA_IsInvokePatternAvailable:= <False>
UIA_IsMultipleViewPatternAvailable:= <False>
UIA_IsRangeValuePatternAvailable:= <False>
UIA_IsScrollPatternAvailable:= <False>
UIA_IsScrollItemPatternAvailable:= <False>
UIA_IsSelectionItemPatternAvailable:= <False>
UIA_IsSelectionPatternAvailable:= <False>
UIA_IsTablePatternAvailable:= <False>
UIA_IsTableItemPatternAvailable:= <False>
UIA_IsTextPatternAvailable:= <False>
UIA_IsTogglePatternAvailable:= <False>
UIA_IsTransformPatternAvailable:= <False>
UIA_IsValuePatternAvailable:= <True>
UIA_IsWindowPatternAvailable:= <False>
UIA_ValueIsReadOnly:= <False>
UIA_RangeValueValue:= <0>
UIA_RangeValueIsReadOnly:= <True>
UIA_RangeValueMinimum:= <0>
UIA_RangeValueMaximum:= <0>
UIA_RangeValueLargeChange:= <0>
UIA_RangeValueSmallChange:= <0>
UIA_ScrollHorizontalScrollPercent:= <0>
UIA_ScrollHorizontalViewSize:= <100>
UIA_ScrollVerticalScrollPercent:= <0>
UIA_ScrollVerticalViewSize:= <100>
UIA_ScrollHorizontallyScrollable:= <False>
UIA_ScrollVerticallyScrollable:= <False>
UIA_SelectionCanSelectMultiple:= <False>
UIA_SelectionIsSelectionRequired:= <False>
UIA_GridRowCount:= <0>
UIA_GridColumnCount:= <0>
UIA_GridItemRow:= <0>
UIA_GridItemColumn:= <0>
UIA_GridItemRowSpan:= <1>
UIA_GridItemColumnSpan:= <1>
UIA_DockDockPosition:= <5>
UIA_ExpandCollapseExpandCollapseState:= <3>
UIA_MultipleViewCurrentView:= <0>
UIA_WindowCanMaximize:= <False>
UIA_WindowCanMinimize:= <False>
UIA_WindowWindowVisualState:= <0>
UIA_WindowWindowInteractionState:= <0>
UIA_WindowIsModal:= <False>
UIA_WindowIsTopmost:= <False>
UIA_SelectionItemIsSelected:= <False>
UIA_TableRowOrColumnMajor:= <2>
UIA_ToggleToggleState:= <2>
UIA_TransformCanMove:= <False>
UIA_TransformCanResize:= <False>
UIA_TransformCanRotate:= <False>
UIA_IsLegacyIAccessiblePatternAvailable:= <True>
UIA_LegacyIAccessibleChildId:= <0>
UIA_LegacyIAccessibleName:= <back and then put it back in the frame because he wants to do this long, and where his child throws up take the picture out of the frame I didn't know where you're going>
UIA_LegacyIAccessibleDescription:= <Автоматические субтитры>
UIA_LegacyIAccessibleRole:= <42>
UIA_LegacyIAccessibleState:= <1048580>
UIA_IsDataValidForForm:= <False>
UIA_ProviderDescription:= <[pid:69364,providerId:0x0 Main(parent link):Microsoft: MSAA Proxy (unmanaged:UIAutomationCore.DLL)]>
UIA_IsItemContainerPatternAvailable:= <False>
UIA_IsVirtualizedItemPatternAvailable:= <False>
UIA_IsSynchronizedInputPatternAvailable:= <False>
UIA_OptimizeForVisualContent:= <False>
UIA_IsObjectModelPatternAvailable:= <False>
UIA_AnnotationAnnotationTypeId:= <60000>
UIA_IsAnnotationPatternAvailable:= <False>
UIA_IsTextPattern2Available:= <False>
UIA_StylesStyleId:= <0>
UIA_StylesFillColor:= <0>
UIA_StylesFillPatternColor:= <0>
UIA_IsStylesPatternAvailable:= <False>
UIA_IsSpreadsheetPatternAvailable:= <False>
UIA_IsSpreadsheetItemPatternAvailable:= <False>
UIA_Transform2CanZoom:= <False>
UIA_IsTransformPattern2Available:= <False>
UIA_LiveSetting:= <0>
UIA_IsTextChildPatternAvailable:= <False>
UIA_IsDragPatternAvailable:= <False>
UIA_DragIsGrabbed:= <False>
UIA_IsDropTargetPatternAvailable:= <False>
UIA_Transform2ZoomLevel:= <1>
UIA_Transform2ZoomMinimum:= <1>
UIA_Transform2ZoomMaximum:= <1>
UIA_IsTextEditPatternAvailable:= <False>
UIA_IsPeripheral:= <False>
UIA_IsCustomNavigationPatternAvailable:= <False>
UIA_PositionInSet:= <0>
UIA_SizeOfSet:= <0>
UIA_Level:= <0>
UIA_LandmarkType:= <0>
UIA_FillType:= <0>
UIA_VisualEffects:= <0>
UIA_IsSelectionPattern2Available:= <False>
UIA_Selection2ItemCount:= <0>
UIA_HeadingLevel:= <80050>
UIA_IsDialog:= <False>
а вот что находит UIASpy
Код:
Treeview Element                                    Edit: long, and where his child throws up take the picture out of the frame I didn't know where you're going that's incredible amazing kid fun to be a long trip to keep us posted on the kids are like going to have to figure out when this cake is an account followed every year 
                                                    
Element Properties (identification)                 
$UIA_ControlTypePropertyId                          $UIA_EditControlTypeId
$UIA_NamePropertyId                                 long, and where his child throws up take the picture out of the frame I didn't know where you're going that's incredible amazing kid fun to be a long trip to keep us posted on the kids are like going to have to figure out when this cake is an account followed every year 
                                                    
Element Properties (session unique)                 
$UIA_ProcessIdPropertyId                            69364
                                                    
Element Properties (information)                    
$UIA_BoundingRectanglePropertyId                    l=2069,t=1111,w=543,h=439
$UIA_LocalizedControlTypePropertyId                 поле
$UIA_ProviderDescriptionPropertyId                  [pid:69364,providerId:0x0 Main(parent link):Microsoft: MSAA Proxy (unmanaged:UIAutomationCore.DLL)]
                                                    
Element Properties (has/is info)                    
$UIA_HasKeyboardFocusPropertyId                     False
$UIA_IsContentElementPropertyId                     True
$UIA_IsControlElementPropertyId                     True
$UIA_IsDataValidForFormPropertyId                   False
$UIA_IsEnabledPropertyId                            True
$UIA_IsKeyboardFocusablePropertyId                  True
$UIA_IsOffscreenPropertyId                          False
$UIA_IsPasswordPropertyId                           False
$UIA_IsRequiredForFormPropertyId                    False
                                                    
Control Patterns (element actions)                  
$UIA_IsLegacyIAccessiblePatternAvailablePropertyId  True (LegacyIAccessiblePattern)
$UIA_IsValuePatternAvailablePropertyId              True (ValuePattern)
                                                    
Control Pattern Properties                          
$UIA_LegacyIAccessibleChildIdPropertyId             0
$UIA_LegacyIAccessibleDefaultActionPropertyId       
$UIA_LegacyIAccessibleDescriptionPropertyId         Автоматические субтитры
$UIA_LegacyIAccessibleHelpPropertyId                
$UIA_LegacyIAccessibleKeyboardShortcutPropertyId    
$UIA_LegacyIAccessibleNamePropertyId                long, and where his child throws up take the picture out of the frame I didn't know where you're going that's incredible amazing kid fun to be a long trip to keep us posted on the kids are like going to have to figure out when this cake is an account followed every year 
$UIA_LegacyIAccessibleRolePropertyId                42 = $ROLE_SYSTEM_TEXT
$UIA_LegacyIAccessibleStatePropertyId               1048576 = $STATE_SYSTEM_FOCUSABLE
$UIA_LegacyIAccessibleValuePropertyId               
$UIA_ValueIsReadOnlyPropertyId                      False
$UIA_ValueValuePropertyId                           
                                                    
Control Pattern Methods                             
LegacyIAccessible Pattern Methods                   
                                                    DoDefaultAction()
                                                    Select(long)
                                                    SetValue(wstr)
                                                    GetIAccessible(idispatch*)
                                                    CurrentChildId(int*)
                                                    CurrentDefaultAction(bstr*)
                                                    CurrentDescription(bstr*)
                                                    CurrentHelp(bstr*)
                                                    CurrentKeyboardShortcut(bstr*)
                                                    CurrentName(bstr*)
                                                    CurrentRole(uint*)
                                                    CurrentState(uint*)
                                                    CurrentValue(bstr*)
                                                    GetCurrentSelection(ptr*)
Value Pattern Methods                               
                                                    SetValue($sValue)
                                                    CurrentValue($sValue*)
                                                    CurrentIsReadOnly($bIsReadOnly*)
                                                    
Parents from Desktop                                Pane: Рабочий стол 1
                                                    Pane: Bethesda - Twitch – Google Chrome Canary
                                                    Pane: Chrome_WidgetWin_1
                                                    Pane
                                                    Pane
                                                    
Parent to child index                               0
 
Верх