Okay, using a program called "Notability" for taking notes now. I would like to create a shortcut for changing text colors, etc. However, I'm having trouble scripting the UI. The changing colors is not in the menu bar (otherwise it would be a piece of cake).
I'm trying to click on the color selection (see image below), but I'm getting an error. Not sure what exactly it means.
Here's the website.
Here's what I get from a window inspection tool I use:
application Process "Notability"
window 1 Note Aug 6, 2018
button 1
menu button 1
menu button "117%"
radio group 1
radio button 1
radio button 2
radio button 3
radio button 4
radio button 5
checkbox 1
checkbox 2
button 2
text field 1
button 1
scroll area 1
outline 1
row 1
UI element 1
static text "6"
static text "All Notes"
row 2
UI element 1
static text "0"
static text "Unfiled Notes"
row 3
UI element 1
static text "2018-19 Fall"
UI element 2
row 4
UI element 1
static text "1"
static text "Education"
row 5
UI element 1
static text "0"
static text "Am Pol Theory"
row 6
UI element 1
static text "0"
static text "Python"
row 7
UI element 1
static text "0"
static text "Astro"
row 8
UI element 1
static text "2018-19 summer"
UI element 2
row 9
UI element 1
static text "5"
static text "Bold"
column 1
menu button 3
progress indicator 1
button 3
button 4
scroll area 2
table 1
row 1
UI element 1
static text "5 product inclusion Aug 6, 2018"
static text "Today at 3:04 PM"
image 1
image 2
row 2
UI element 1
static text "4 Tech&Culture Aug 6, 2018 (2)"
static text "Today at 1:59 PM"
image 1
row 3
UI element 1
static text "1 Note Aug 6, 2018"
static text "Today at 1:37 PM"
image 1
image 2
row 4
UI element 1
static text "2 Keynote Note Aug 6, 2018 (2)"
static text "Today at 1:37 PM"
image 1
image 2
row 5
UI element 1
static text "3 Who is google Note Aug 6, 2018"
static text "Today at 1:37 PM"
image 1
image 2
column 1
scroll bar 1
value indicator 1
button 1
button 2
button 3
button 4
scroll area 3
scroll bar 1
value indicator 1
button 1
button 2
button 3
button 4
button "1x"
button 6
button 7
slider 1
value indicator 1
static text "58:33"
checkbox 3
button 8
static text "Text Styling"
static text "Size:"
static text "Style:"
static text "Lists:"
static text "Color:"
pop up button 1
pop up button 2
radio group 2
radio button 1
radio button 2
radio button 3
pop up button 3
pop up button 4
button 9
button 10
button 11
static text "1 Note Aug 6, 2018"
Here's my accessibility inspector:
<AXApplication: “Notability”>
<AXWindow: “5 product inclusion Aug 6, 2018”>
<AXPopUpButton>
Attributes:
AXEnabled: “1”
AXParent: “<AXWindow: “5 product inclusion Aug 6, 2018”>”
AXSize: “w=51 h=27”
AXFocused (W): “0”
AXChildren: “<array of size 0>”
AXRole: “AXPopUpButton”
AXTopLevelUIElement: “<AXWindow: “5 product inclusion Aug 6, 2018”>”
AXHelp: “(null)”
AXPosition: “x=1334 y=260”
AXValue: “”
AXWindow: “<AXWindow: “5 product inclusion Aug 6, 2018”>”
AXRoleDescription: “pop up button”
AXFrame: “x=1334 y=260 w=51 h=27”
Actions:
AXShowMenu - show menu
AXPress - press
Here's my code so far:
tell application "System Events"
tell process "Notability"
tell window 1
click "pop up button"
end tell
end tell
end tell
Here's the error I'm getting:
error "System Events got an error: Can’t make \"pop up button\" into type UI element." number -1700 from "pop up button" to UI element
Here's an image of the section I'm trying to script:
tell application "Notability" to activate
and adelay 0.5
before thetell application "System Events"
block. Additionally you need to be specific about which pop up button to click, you can just sayclick "pop up button"
without saying which pop up button.