Now we grab the names of the buttons.
Tell me which is the one to click.
tell application "VeraCrypt"
activate
tell application "System Events"
tell process "VeraCrypt"
set frontmost to true
--repeat until exists window "VeraCrypt"
--delay 0.1 # Don't forget that this loop fails
--end repeat
repeat 10 times
if exists window "VeraCrypt" then exit repeat
delay 0.1
end repeat
if not (exists window "VeraCrypt") then error "The window VeraCrypt is not available"
tell window "VeraCrypt"
--class of UI elements --> {group, scroll bar, group, button, button, button, group, image, combo box, button, checkbox, button, button, group, button, group, button, group, button, group, button, button, button, button, static text}
# The same list with the names of UI elements
--> {group 1, scroll bar 1, group 2, button "Create Volume", button "Volume Properties...", button "Wipe Cache", group "Volume", image 1, combo box 1, button "Select File...", checkbox "Never save history", button "Volume Tools...", button "Select Device...", group 4, button "Mount", group 5, button "Mount All Devices", group 6, button "Dismount All", group 7, button "Close", button 11, button 12, button 13, static text "VeraCrypt"}
tell scroll bar 1
--class of UI elements --> {value indicator, button, button, button, button}
name of buttons -->
end tell
end tell #window
end tell # process Veracrypt
end tell # Application System Events
end tell # Application Veracrypt
Yvan KOENIG running High Sierra 10.13.6 in French (VALLAURIS, France) lundi 16 décembre 2019 12:09:35