AppleScript stopped working after update to 10.13

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

May you try this version which is supposed to achieve the wanted task ?

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 # scroll bar 1
				*)
				tell combo box 1
					set value of attribute "AXFocused" to true
					-- delay 0.5 # may be useful here
					set its value to "/Volumes/Data/VC/file"
				end tell # combo box 1
				click button "Mount"
			end tell # window "VeraCrypt"
		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 21:54:18

Yvan good morning! It works! What a nice thing to wake up to. Thanks. And also thanks to KniazidisR.

Some fine tweeting if we can and if I am not over-stretching you willingness to help. See pic

https://ibb.co/WgCgMZt

As you can see there are different slots. The green one is the one selected by me. The script however takes whatever slot was selected before. That is why I scrolled up and than down in my original script. I like to be able to define the slot. Reason be is that if I load more than one encrypted volume each one needs to be in its own slot.

Your script is complex for me, and looking at it I do not know where to insert, and how, such a command.

If it is easy to do great, if not I need to live with it, I am already very happy with this result as it makes mounting a volume so much easier compared to doing it manually.