I have the following script that worked fine under 10.12 and stopped working under 10.13. Now I have in my security and privacy panel, AppleScript and etc. activated, see pic. I found a post here that made me do this https://stackoverflow.com/questions/55917877/applescript-used-in-my-cocoa-mac-app-stopped-working-in-osx-10-14
The script runs and does nothing. Sometimes it looks like a window pops up but it is so fast I can to see if this is so or what it is.
I found that if I run the script form the editor 10 or more times in a row it all of a sudden works, once. But this is pretty inconsistent.
Any ideas?
tell application "VeraCrypt"
	activate
end tell
delay 2
tell application "VeraCrypt"
	activate
	tell application "System Events"
		tell process "System Preferences"
			delay 1
			repeat 20 times
				key code 126
			end repeat
			key code 125
			keystroke tab
			delay 1
			keystroke "/Volumes/Data/VC/file"
			key code 76
		end tell
	end tell
end tell