Thanks.
That script opens VC and next my System Preferences (not sure why we would need that) and does nothing more. However the script hangs. so force quit in order.
Thanks.
That script opens VC and next my System Preferences (not sure why we would need that) and does nothing more. However the script hangs. so force quit in order.
Ok no errors, and no results. VC i up front when I run it. But otherwise nothing.
key code 126 is the arrow key up and it is not doing that to begin with. it is to set the position in the VC window to position 1 to prevent it loading in any other position.
see pic
https://ibb.co/7kffMmy
again no luck, and no real success. the ‘Replies’ field shows:
tell application "VeraCrypt"
activate
end tell
tell application "System Events"
exists window "VeraCrypt" of application process "VeraCrypt"
--> true
click button 4 of scroll bar 1 of window "VeraCrypt" of application process "VeraCrypt"
--> button 4 of scroll bar 1 of window "VeraCrypt" of application process "VeraCrypt"
click button 4 of scroll bar 1 of window "VeraCrypt" of application process "VeraCrypt"
--> button 4 of scroll bar 1 of window "VeraCrypt" of application process "VeraCrypt"
click button 4 of scroll bar 1 of window "VeraCrypt" of application process "VeraCrypt"
--> button 4 of scroll bar 1 of window "VeraCrypt" of application process "VeraCrypt"
click button 4 of scroll bar 1 of window "VeraCrypt" of application process "VeraCrypt"
--> button 4 of scroll bar 1 of window "VeraCrypt" of application process "VeraCrypt"
click button 4 of scroll bar 1 of window "VeraCrypt" of application process "VeraCrypt"
--> button 4 of scroll bar 1 of window "VeraCrypt" of application process "VeraCrypt"
click button 4 of scroll bar 1 of window "VeraCrypt" of application process "VeraCrypt"
--> button 4 of scroll bar 1 of window "VeraCrypt" of application process "VeraCrypt"
click button 4 of scroll bar 1 of window "VeraCrypt" of application process "VeraCrypt"
--> button 4 of scroll bar 1 of window "VeraCrypt" of application process "VeraCrypt"
click button 4 of scroll bar 1 of window "VeraCrypt" of application process "VeraCrypt"
--> button 4 of scroll bar 1 of window "VeraCrypt" of application process "VeraCrypt"
click button 4 of scroll bar 1 of window "VeraCrypt" of application process "VeraCrypt"
--> button 4 of scroll bar 1 of window "VeraCrypt" of application process "VeraCrypt"
click button 4 of scroll bar 1 of window "VeraCrypt" of application process "VeraCrypt"
--> button 4 of scroll bar 1 of window "VeraCrypt" of application process "VeraCrypt"
click button 4 of scroll bar 1 of window "VeraCrypt" of application process "VeraCrypt"
--> button 4 of scroll bar 1 of window "VeraCrypt" of application process "VeraCrypt"
click button 4 of scroll bar 1 of window "VeraCrypt" of application process "VeraCrypt"
--> button 4 of scroll bar 1 of window "VeraCrypt" of application process "VeraCrypt"
click button 4 of scroll bar 1 of window "VeraCrypt" of application process "VeraCrypt"
--> button 4 of scroll bar 1 of window "VeraCrypt" of application process "VeraCrypt"
click button 4 of scroll bar 1 of window "VeraCrypt" of application process "VeraCrypt"
--> button 4 of scroll bar 1 of window "VeraCrypt" of application process "VeraCrypt"
click button 4 of scroll bar 1 of window "VeraCrypt" of application process "VeraCrypt"
--> button 4 of scroll bar 1 of window "VeraCrypt" of application process "VeraCrypt"
click button 4 of scroll bar 1 of window "VeraCrypt" of application process "VeraCrypt"
--> button 4 of scroll bar 1 of window "VeraCrypt" of application process "VeraCrypt"
click button 4 of scroll bar 1 of window "VeraCrypt" of application process "VeraCrypt"
--> button 4 of scroll bar 1 of window "VeraCrypt" of application process "VeraCrypt"
click button 4 of scroll bar 1 of window "VeraCrypt" of application process "VeraCrypt"
--> button 4 of scroll bar 1 of window "VeraCrypt" of application process "VeraCrypt"
click button 4 of scroll bar 1 of window "VeraCrypt" of application process "VeraCrypt"
--> button 4 of scroll bar 1 of window "VeraCrypt" of application process "VeraCrypt"
click button 4 of scroll bar 1 of window "VeraCrypt" of application process "VeraCrypt"
--> button 4 of scroll bar 1 of window "VeraCrypt" of application process "VeraCrypt"
key code 125
keystroke " "
keystroke "/Volumes/Data/VC/file"
key code 76
end tell
Maybe this helps I checked for all the UI information of VC. I experiemented but my AS skill level is to low.
{group 1 of window "VeraCrypt" of application process "VeraCrypt" of application "System Events", scroll bar 1 of window "VeraCrypt" of application process "VeraCrypt" of application "System Events", value indicator 1 of scroll bar 1 of window "VeraCrypt" of application process "VeraCrypt" of application "System Events", button 1 of scroll bar 1 of window "VeraCrypt" of application process "VeraCrypt" of application "System Events", button 2 of scroll bar 1 of window "VeraCrypt" of application process "VeraCrypt" of application "System Events", button 3 of scroll bar 1 of window "VeraCrypt" of application process "VeraCrypt" of application "System Events", button 4 of scroll bar 1 of window "VeraCrypt" of application process "VeraCrypt" of application "System Events", group 2 of window "VeraCrypt" of application process "VeraCrypt" of application "System Events", button "Create Volume" of window "VeraCrypt" of application process "VeraCrypt" of application "System Events", button "Volume Properties..." of window "VeraCrypt" of application process "VeraCrypt" of application "System Events", button "Wipe Cache" of window "VeraCrypt" of application process "VeraCrypt" of application "System Events", group "Volume" of window "VeraCrypt" of application process "VeraCrypt" of application "System Events", static text "Volume" of group "Volume" of window "VeraCrypt" of application process "VeraCrypt" of application "System Events", image 1 of window "VeraCrypt" of application process "VeraCrypt" of application "System Events", combo box 1 of window "VeraCrypt" of application process "VeraCrypt" of application "System Events", button 1 of combo box 1 of window "VeraCrypt" of application process "VeraCrypt" of application "System Events", button "Select File..." of window "VeraCrypt" of application process "VeraCrypt" of application "System Events", checkbox "Never save history" of window "VeraCrypt" of application process "VeraCrypt" of application "System Events", button "Volume Tools..." of window "VeraCrypt" of application process "VeraCrypt" of application "System Events", button "Select Device..." of window "VeraCrypt" of application process "VeraCrypt" of application "System Events", group 4 of window "VeraCrypt" of application process "VeraCrypt" of application "System Events", button "Mount" of window "VeraCrypt" of application process "VeraCrypt" of application "System Events", group 5 of window "VeraCrypt" of application process "VeraCrypt" of application "System Events", button "Mount All Devices" of window "VeraCrypt" of application process "VeraCrypt" of application "System Events", group 6 of window "VeraCrypt" of application process "VeraCrypt" of application "System Events", button "Dismount All" of window "VeraCrypt" of application process "VeraCrypt" of application "System Events", group 7 of window "VeraCrypt" of application process "VeraCrypt" of application "System Events", button "Close" of window "VeraCrypt" of application process "VeraCrypt" of application "System Events", button 11 of window "VeraCrypt" of application process "VeraCrypt" of application "System Events", button 12 of window "VeraCrypt" of application process "VeraCrypt" of application "System Events", button 13 of window "VeraCrypt" of application process "VeraCrypt" of application "System Events", static text "VeraCrypt" of window "VeraCrypt" of application process "VeraCrypt" of application "System Events"}
Just for info, here is the content of your late message after a bit of cleaning.
group 1
scroll bar 1
value indicator 1 of scroll bar 1
button 1 of scroll bar 1
button 2 of scroll bar 1
button 3 of scroll bar 1
button 4 of scroll bar 1
group 2
button "Create Volume"
button "Volume Properties..."
button "Wipe Cache"
group "Volume"
static text "Volume" of group "Volume"
Image 1
combo box 1
button 1 of 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"
All these UI elements belong to : window “VeraCrypt” of application process “VeraCrypt” of application “System Events”
Yvan KOENIG running High Sierra 10.13.6 in French (VALLAURIS, France) vendredi 13 décembre 2019 19:21:13
Rebuilt the UI structure
Yvan thank you! it helps me see what is reported there. Learning all the time.
Here is what I am trying but get stuck:
tell application "VeraCrypt"
tell application "System Events"
tell process "System Preferences"
try
tell window "VeraCrypt" of application process "VeraCrypt" of application "System Events" of group 1 of scroll bar 1 of value indicator 1 of scroll bar 1 of value indicator 1 of scroll bar 1
delay 0.2
select (button 1 of scroll bar 1)
end tell
on error
tell window "VeraCrypt" of application process "VeraCrypt" of application "System Events" of group 1 of scroll bar 1 of value indicator 1 of scroll bar 1 of value indicator 1 of scroll bar 1
delay 0.2
select (button 1 of scroll bar 1)
end tell
end try
end tell
end tell
end tell
I get error:
error “System Events got an error: Can’t get application "System Events" of group 1 of scroll bar 1 of value indicator 1 of scroll bar 1 of value indicator 1 of scroll bar 1 of process "System Preferences".” number -1728 from application “System Events” of «class sgrp» 1 of «class scrb» 1 of «class vali» 1 of «class scrb» 1 of «class vali» 1 of «class scrb» 1 of «class prcs» “System Preferences”
Means it hangs on the select button line.
To make sure I understand. you are saying you think VC is not bale to have the window selected without mouse movement? that is why to recommend using cliclick?
thanks KniazidisR.
Yvan KOENIG running High Sierra 10.13.6 in French (VALLAURIS, France) samedi 14 décembre 2019 11:37:30
Hi Yvan,
I get an error:
error “System Events got an error: Can’t get scroll bar 1 of group 1 of window "VeraCrypt" of process "VeraCrypt". Invalid index.” number -1719 from scroll bar 1 of group 1 of window “VeraCrypt” of process “VeraCrypt”
Yvan KOENIG running High Sierra 10.13.6 in French (VALLAURIS, France) samedi 14 décembre 2019 18:19:48
Morning KniazidisR
sorry folks for delay, I was on the road.
Running your script I get:
Result:
error “Can’t get CGPointZero.” number -1728 from CGPointZero
Morning Yvan, yout script returns:
tell application "VeraCrypt"
activate
end tell
tell application "System Events"
set frontmost of process "VeraCrypt" to true
exists window "VeraCrypt" of process "VeraCrypt"
--> true
exists window "VeraCrypt" of process "VeraCrypt"
--> true
get class of every UI element of window "VeraCrypt" of process "VeraCrypt"
--> {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}
(*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*)
get class of every UI element of group 1 of window "VeraCrypt" of process "VeraCrypt"
--> {}
(**)
end tell
VC activates but that is all.
Yvan KOENIG running High Sierra 10.13.6 in French (VALLAURIS, France) lundi 16 décembre 2019 09:25:04
it loops
Yvan KOENIG running High Sierra 10.13.6 in French (VALLAURIS, France) lundi 16 décembre 2019 09:44:05
OK here is what I get:
tell application "VeraCrypt"
activate
end tell
tell application "System Events"
set frontmost of process "VeraCrypt" to true
exists window "VeraCrypt" of process "VeraCrypt"
--> true
exists window "VeraCrypt" of process "VeraCrypt"
--> true
get class of every UI element of window "VeraCrypt" of process "VeraCrypt"
--> {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}
count every group of window "VeraCrypt" of process "VeraCrypt"
--> 7
(*group 1*)
get class of every UI element of group 1 of window "VeraCrypt" of process "VeraCrypt"
--> {}
(**)
(*group 2*)
get class of every UI element of group 2 of window "VeraCrypt" of process "VeraCrypt"
--> {}
(**)
(*group 3*)
get class of every UI element of group 3 of window "VeraCrypt" of process "VeraCrypt"
--> {static text}
(*static text*)
(*group 4*)
get class of every UI element of group 4 of window "VeraCrypt" of process "VeraCrypt"
--> {}
(**)
(*group 5*)
get class of every UI element of group 5 of window "VeraCrypt" of process "VeraCrypt"
--> {}
(**)
(*group 6*)
get class of every UI element of group 6 of window "VeraCrypt" of process "VeraCrypt"
--> {}
(**)
(*group 7*)
get class of every UI element of group 7 of window "VeraCrypt" of process "VeraCrypt"
--> {}
(**)
end tell
script runs till the end.
Yvan KOENIG running High Sierra 10.13.6 in French (VALLAURIS, France) lundi 16 décembre 2019 10:16:22
runs without errors, but selects nothing in the window.
Log window shows:
tell application "VeraCrypt"
activate
end tell
tell application "System Events"
set frontmost of process "VeraCrypt" to true
exists window "VeraCrypt" of process "VeraCrypt"
--> true
exists window "VeraCrypt" of process "VeraCrypt"
--> true
get class of every UI element of window "VeraCrypt" of process "VeraCrypt"
--> {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}
get class of every UI element of scroll bar 1 of window "VeraCrypt" of process "VeraCrypt"
--> {value indicator, button, button, button, button}
(*value indicator, button, button, button, button*)
end tell
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