0
我的問題是,我無法找到想要設置值的滑塊的正確路徑。我找不到Slider1的路徑,我想爲它設置一個值。
這是我現在的代碼,也有UIElemtInspector路徑,非常感謝任何幫助。 :)
UIElemtInspector路徑:
<AXApplication: 「OSCulator」>
<AXWindow: 「Preferences」>
<AXTabGroup>
<AXGroup>
<AXSlider>
Attributes:
AXRole: 「AXSlider」
AXRoleDescription: 「slider」
AXHelp: 「(null)」
AXEnabled: 「1」
AXFocused (W): 「0」
AXParent: 「<AXGroup>」
AXWindow: 「<AXWindow: 「Preferences」>」
AXTopLevelUIElement: 「<AXWindow: 「Preferences」>」
AXPosition: 「x=263 y=513」
AXSize: 「w=214 h=21」
AXValue (W): 「20.35702720207254」
AXMinValue: 「0」
AXMaxValue: 「100」
AXChildren: 「<array of size 1>」
AXAllowedValues: 「(null)」
AXOrientation: 「AXHorizontalOrientation」
AXIdentifier: 「_NS:405」
Actions:
AXIncrement - increment
AXDecrement - decrement
代碼:
if application "OSCulator" is running then
tell application "System Events"
tell application process "OSCulator"
tell menu bar 1
tell menu bar item "OSCulator"
tell menu "OSCulator"
click menu item "Preferences..."
end tell
end tell
end tell
end tell
end tell
tell application "OSCulator" to activate
tell application "System Events" to tell application process "OSCulator" to tell window "Preferences" to tell tab group 1
click radio button "Outputs"
end tell
end if