I am utilizing the under code to replace the modifier keys to my requirement.

Is there a technique to replace this within the background with out the person’s discover?

inform utility "System Preferences"
    
    if not operating then
        run
        inform utility "System Occasions"
            set bailOut to twenty
            repeat till (exists of utility course of "System Preferences") = true
                set bailOut to bailOut - 1
                if bailOut ≤ 0 then error "Timeout on Run System Preferences!"
            finish repeat
        finish inform
    finish if
    
    --activate
    
    set present pane to pane "com.apple.choice.keyboard"
    set bailOut to twenty
    repeat till identify of entrance window = "Keyboard"
        delay 0.1
        set bailOut to bailOut - 1
        if bailOut ≤ 0 then error "Timeout on Reveal Anchor Enter of Keyboard Choice!"
    finish repeat
    
    inform utility "System Occasions"
        inform course of "System Preferences"
            click on button "Modifier Keys…" of tab group 1 of window "Keyboard"
            click on pop up button 6 of sheet 1 of window "Keyboard"
            click on menu merchandise 2 of menu 1 of pop up button 6 of sheet 1 of window "Keyboard"
            click on pop up button 1 of sheet 1 of window "Keyboard" --Command
            click on menu merchandise 8 of menu 1 of pop up button 1 of sheet 1 of window "Keyboard"
            click on button "OK" of sheet 1 of window "Keyboard"
        finish inform
    finish inform
finish inform


inform utility "System Preferences"
    give up
finish inform

Thanks

Ashwin Gopal is a brand new contributor to this web site. Take care in asking for clarification, commenting, and answering.
Try our Code of Conduct.


You will need to
log in to reply this query.

Browse different questions tagged .