Sunday, October 22, 2017

#1 2017-04-17 03:25:14 pm

Gadi
Member
Registered: 2015-07-26
Posts: 2

"AXIncrement" of slider

Hi,

I’m using this script to increment a slider value:

activate application "App"
tell application "System Events"
    tell process "App"
        perform action "AXIncrement" of slider 141 of group 1 of front window
    end tell
end tell


This slider has about 1000 increment & decrement steps, so in order to smoothly control this slider I need to perform this action very quick.

Inside this group (group 1) there are about 400 sliders, so in reality it takes almost a second to perform.

Is there a way to lock the script (similar to ‘Accessibility Inspector’ command F7 ‘element lock’) to that specific path and every time the script runs - to just perform the "AXIncrement" action instead of browsing again through the whole path?


Thanks in advance!
Gadi.

Model: Mac Pro
AppleScript: 2.7
Browser: Firefox 52.0
Operating System: Mac OS X (10.10)


Filed under: AXIncrement

Offline

 

#2 2017-04-17 03:44:25 pm

Yvan Koenig
Member
Registered: 2006-09-14
Posts: 3200

Re: "AXIncrement" of slider

You may use a loop.

Applescript:

set nbIncrerments to 100 # adjust to fit your needs
activate application "App"
tell application "System Events"
tell process "App"
repeat nbIncrements times
perform action "AXIncrement" of slider 141 of group 1 of front window
end repeat
end tell
end tell

Yvan KOENIG running Sierra 10.12.4 in French (VALLAURIS, France) lundi 17 avril 2017 22:44:11

Offline

 

#3 2017-04-17 04:14:01 pm

Gadi
Member
Registered: 2015-07-26
Posts: 2

Re: "AXIncrement" of slider

Thanks Yvan,

But I'm not looking to skip all those increment steps, I want to browse/scroll through them.

For example when using 'UI Browser' to increment/decrement these values - there's no pause after clicking the action - it happens immediately.

Another example would be something similar to 'ControllerMate' block that is locked to a certain ui element action, when physically moving a usb controller - the ui element responds immediately.

Is it only possible with an open application and not with a script?

Thanks again!
Gadi.

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)