Saturday, December 16, 2017

#1 2017-09-16 01:35:33 pm

CAPTURE-A
Member
From:: Brooklyn
Registered: 2017-01-15
Posts: 6

Preference Pane - Click Button Problem

Hello! I’m still relatively new to Apple Script and searched out potential solutions for my script issue.

The Script opens up the Shades Preferences but where my problem lies is that I want to have the script click the “Start” button. I’m not sure if I need to be using “tab groups”, etc,  which I’ve seen other scripts use from my research?

Any guidance will be appreciated.

-Aaron


https://www.flickr.com/photos/151467979 … res/8PgT16

Applescript:

tell application "System Preferences"
   activate
   set current pane to pane "Shades"
end tell

tell application "System Events"
   tell process "System Preferences"
       tell window "Shades"
           click button "Start" of window "Shades"
           
       end tell
   end tell
end tell

Offline

 

#2 2017-09-16 04:35:42 pm

CAPTURE-A
Member
From:: Brooklyn
Registered: 2017-01-15
Posts: 6

Re: Preference Pane - Click Button Problem

I managed to figure it out.

Here's the result that worked for me.

Thanks as always!

-Aaron


Applescript:

tell application "System Preferences"
   activate
   set current pane to pane "Shades"
end tell

tell application "System Events"
   click button 1 of window 1 of process "System Preferences"
end tell

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)