Tuesday, September 29, 2020

#1 2019-12-13 05:59:51 am

ChangeAgent
Member
From:: Scotland
Registered: 2008-03-07
Posts: 345

AppleScript stopped working after update to 10.13

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/559 … -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?

Applescript:

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


Filed under: 10.13

Offline

 

#2 2019-12-13 07:10:24 am

ChangeAgent
Member
From:: Scotland
Registered: 2008-03-07
Posts: 345

Re: AppleScript stopped working after update to 10.13

sorry forgot pic

https://ibb.co/sbwSCPY

Offline

 

#3 2019-12-13 07:20:14 am

Yvan Koenig
Member
Registered: 2006-09-14
Posts: 4569

Re: AppleScript stopped working after update to 10.13

You may try :

Applescript:

tell application "VeraCrypt"
   activate
end tell
tell application "VeraCrypt"
   activate
   tell application "System Events"
       tell process "System Preferences"
           set frontmost to true # ADDED
           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

As I don't own VeraCrypt, I can't test.

Yvan KOENIG running High Sierra 10.13.6 in French (VALLAURIS, France) vendredi 13 décembre 2019  14:17:29

Offline

 

#4 2019-12-13 07:57:04 am

ChangeAgent
Member
From:: Scotland
Registered: 2008-03-07
Posts: 345

Re: AppleScript stopped working after update to 10.13

Yvan Koenig wrote:

You may try :

Applescript:

tell application "VeraCrypt"
   activate
end tell
tell application "VeraCrypt"
   activate
   tell application "System Events"
       tell process "System Preferences"
           set frontmost to true # ADDED
           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

As I don't own VeraCrypt, I can't test.

Yvan KOENIG running High Sierra 10.13.6 in French (VALLAURIS, France) vendredi 13 décembre 2019  14:17:29



Hi Yvan.

your script gives me the following error.

tell application "VeraCrypt"
    activate
    activate
end tell
tell application "System Events"
    set frontmost of process "System Preferences" to true
        --> error number -1728 from process "System Preferences"
Result:
error "System Events got an error: Can’t set process \"System Preferences\" to true." number -10006 from process "System Preferences"


PS VeryCrypt is a brilliant open source application free to use.

Offline

 

#5 2019-12-13 08:07:05 am

ChangeAgent
Member
From:: Scotland
Registered: 2008-03-07
Posts: 345

Re: AppleScript stopped working after update to 10.13

Thanks KniazidisR

KniazidisR wrote:

This project relies on legacy third-party file systems, so it’s unlikely that someone will help you.

But some problems of your script are visible to the naked eye.
For example, you activate one application (VeraCrypt), then you send key codes to a process (System Preferences) that is clearly not frontmost, since frontmost in this case is VeraCrypt window. In addition, key codes should be send to the frontmost window outside the tell process block. They must be sent to the System Events application.

If you described in detail the steps on which you click the mouse, which window opens at each step, then perhaps I could help debug your code without having VeraCrypt on my Mac.




KniazidisR wrote:

This project relies on legacy third-party file systems, so it’s unlikely that someone will help you



Is suppose you mean 10.13 with this?

KniazidisR wrote:


But some problems of your script are visible to the naked eye.
For example, you activate one application (VeraCrypt), then you send key codes to a process (System Preferences) that is clearly not frontmost, since frontmost in this case is VeraCrypt window. In addition, key codes should be send to the frontmost window outside the tell process block. They must be sent to the System Events application.



Ok, not to me but I take your expertise here as given.  One thing is it worked fine till I moved form 10.12 to 10.13.  So that is why it is hard for me to understand, as a novice, why it stopped working.

KniazidisR wrote:

If you described in detail the steps on which you click the mouse, which window opens at each step, then perhaps I could help debug your code without having VeraCrypt on my Mac.



There is no clicking of the mouse, I open the script from the ‘S’ (script button in bar) and it does not work.  The clicking I did in the editor, to see if I can find which step is faulthy, as described and to no avail.

Offline

 

#6 2019-12-13 08:34:53 am

ChangeAgent
Member
From:: Scotland
Registered: 2008-03-07
Posts: 345

Re: AppleScript stopped working after update to 10.13

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.

Last edited by ChangeAgent (2019-12-13 08:38:19 am)

Offline

 

#7 2019-12-13 08:56:12 am

ChangeAgent
Member
From:: Scotland
Registered: 2008-03-07
Posts: 345

Re: AppleScript stopped working after update to 10.13

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

Offline

 

#8 2019-12-13 09:53:03 am

ChangeAgent
Member
From:: Scotland
Registered: 2008-03-07
Posts: 345

Re: AppleScript stopped working after update to 10.13

again no luck, and no real success.  the 'Replies' field shows:

Applescript:

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

Offline

 

#9 2019-12-13 11:20:02 am

ChangeAgent
Member
From:: Scotland
Registered: 2008-03-07
Posts: 345

Re: AppleScript stopped working after update to 10.13

Maybe this helps I checked for all the UI information of VC.  I experiemented but my AS skill level is to low.

Applescript:

{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"}

Offline

 

#10 2019-12-13 12:21:24 pm

Yvan Koenig
Member
Registered: 2006-09-14
Posts: 4569

Re: AppleScript stopped working after update to 10.13

Just for info, here is the content of your late message after a bit of cleaning.

Applescript:

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

Last edited by Yvan Koenig (2019-12-16 03:23:54 am)

Offline

 

#11 2019-12-14 12:38:22 am

ChangeAgent
Member
From:: Scotland
Registered: 2008-03-07
Posts: 345

Re: AppleScript stopped working after update to 10.13

Yvan Koenig wrote:


All these UI elements belong to : window "VeraCrypt" of application process "VeraCrypt" of application "System Events"



Yvan thank you!  it helps me see what is reported there.  Learning all the time.

Here is what I am trying but get stuck:

Applescript:

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.

Offline

 

#12 2019-12-14 12:44:34 am

ChangeAgent
Member
From:: Scotland
Registered: 2008-03-07
Posts: 345

Re: AppleScript stopped working after update to 10.13

KniazidisR wrote:

I see what is problem with this application. The slots area of window "VeraCrypt" is not focused (focus has "Mount" button). To get this area the focus, is need use some mouse click tool, which along with click moves the mouse to clicked position. Something as cliclick. System Events can't do this.

Need click (real click) on some point of slots area of window "VeraCrypt" using cliclick tool before sending keystrokes and key codes.



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?

Offline

 

#13 2019-12-14 01:13:00 am

ChangeAgent
Member
From:: Scotland
Registered: 2008-03-07
Posts: 345

Re: AppleScript stopped working after update to 10.13

thanks KniazidisR.

Offline

 

#14 2019-12-14 04:38:07 am

Yvan Koenig
Member
Registered: 2006-09-14
Posts: 4569

Re: AppleScript stopped working after update to 10.13

Yvan KOENIG running High Sierra 10.13.6 in French (VALLAURIS, France) samedi 14 décembre 2019  11:37:30

Last edited by Yvan Koenig (2019-12-16 10:41:34 am)

Offline

 

#15 2019-12-14 10:46:15 am

ChangeAgent
Member
From:: Scotland
Registered: 2008-03-07
Posts: 345

Re: AppleScript stopped working after update to 10.13

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"

Offline

 

#16 2019-12-14 11:19:56 am

Yvan Koenig
Member
Registered: 2006-09-14
Posts: 4569

Re: AppleScript stopped working after update to 10.13

Yvan KOENIG running High Sierra 10.13.6 in French (VALLAURIS, France) samedi 14 décembre 2019  18:19:48

Last edited by Yvan Koenig (2019-12-16 10:40:49 am)

Offline

 

#17 2019-12-16 01:55:33 am

ChangeAgent
Member
From:: Scotland
Registered: 2008-03-07
Posts: 345

Re: AppleScript stopped working after update to 10.13

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

Offline

 

#18 2019-12-16 01:59:01 am

ChangeAgent
Member
From:: Scotland
Registered: 2008-03-07
Posts: 345

Re: AppleScript stopped working after update to 10.13

Morning Yvan, yout script returns:

Applescript:

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.

Offline

 

#19 2019-12-16 02:27:23 am

Yvan Koenig
Member
Registered: 2006-09-14
Posts: 4569

Re: AppleScript stopped working after update to 10.13

Yvan KOENIG running High Sierra 10.13.6 in French (VALLAURIS, France) lundi 16 décembre 2019  09:25:04

Last edited by Yvan Koenig (2019-12-16 10:40:04 am)

Offline

 

#20 2019-12-16 02:33:39 am

ChangeAgent
Member
From:: Scotland
Registered: 2008-03-07
Posts: 345

Re: AppleScript stopped working after update to 10.13

it loops

tell application "VeraCrypt"
    activate
end tell
tell application "System Events"
    set frontmost of process "VeraCrypt" to true
    exists window "VeraCrypt" of process "VeraCrypt"
        --> false
    exists window "VeraCrypt" of process "VeraCrypt"
        --> false
    exists window "VeraCrypt" of process "VeraCrypt"
        --> false
    exists window "VeraCrypt" of process "VeraCrypt"
        --> false
    exists window "VeraCrypt" of process "VeraCrypt"
        --> false

etc etc

Offline

 

#21 2019-12-16 02:45:17 am

Yvan Koenig
Member
Registered: 2006-09-14
Posts: 4569

Re: AppleScript stopped working after update to 10.13

Yvan KOENIG running High Sierra 10.13.6 in French (VALLAURIS, France) lundi 16 décembre 2019  09:44:05

Last edited by Yvan Koenig (2019-12-16 10:39:30 am)

Offline

 

#22 2019-12-16 02:57:26 am

ChangeAgent
Member
From:: Scotland
Registered: 2008-03-07
Posts: 345

Re: AppleScript stopped working after update to 10.13

OK here is what I get:

Applescript:

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.

Offline

 

#23 2019-12-16 03:17:16 am

Yvan Koenig
Member
Registered: 2006-09-14
Posts: 4569

Re: AppleScript stopped working after update to 10.13

Yvan KOENIG running High Sierra 10.13.6 in French (VALLAURIS, France) lundi 16 décembre 2019  10:16:22

Last edited by Yvan Koenig (2019-12-16 10:42:44 am)

Offline

 

#24 2019-12-16 05:03:47 am

ChangeAgent
Member
From:: Scotland
Registered: 2008-03-07
Posts: 345

Re: AppleScript stopped working after update to 10.13

runs without errors, but selects nothing in the window.

Log window shows:

Applescript:

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

Last edited by ChangeAgent (2019-12-16 05:05:33 am)

Offline

 

#25 2019-12-16 05:10:16 am

Yvan Koenig
Member
Registered: 2006-09-14
Posts: 4569

Re: AppleScript stopped working after update to 10.13

Now we grab the names of the buttons.
Tell me which is the one to click.

Applescript:

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

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)