2

So my problem is in disk warrior there is a drop down window under the "Directory" pane that i can't get applescript to "click". Is there anyway to tell applescript to "click" the drop down window and then click a disk from the list? My boSS wants this whole code automated and this is the one part I'm not sure if i can automate. Here is my code:

do shell script "open /Applications/DiskWarrior.app"
delay 3
tell application "System Events"
    keystroke "my password"
    delay 2
    keystroke return
    delay 3
    keystroke tab
    delay 3
    keystroke return
    delay 20
    --Delay 20 to allow time for the application to fully load
    end tell

After diskwarrior is open the next step would to be select the disk i want to rebuild but as i said i am unsure how to tell applescript to "click" it.

Anyone have some suggestions?

1 Answer 1

2
do shell script "open -a DiskWarrior"
delay 5
tell application "System Events"
    tell process "SecurityAgent"
        set value of text field 2 of scroll area 1 of group 1 of window 1 to "password"
        click button 2 of group 2 of window 1
    end tell
    delay 5
    tell process "DiskWarrior"
        set frontmost to true
        tell pop up button 1 of window 1
            click
            click menu item 2 of menu 1
        end tell
        set visible to false -- workaround for a glitch in the DiskWarrior UI
        set visible to true
        click button "Rebuild" of window 1
    end tell
end tell

I couldn't get clicking the rebuild button to work. Recording actions in Automator worked though:

Sign up to request clarification or add additional context in comments.

2 Comments

Can you get the position of the "Rebuild" button? If so then you can use my MouseTools tool to click at the position. Get it here: hamsoftengineering.com/codeSharing/MouseTools/MouseTools.html
Ill try the position idea, if that doesn't work i honestly don't think anything else will. If any one else has ideas thou please done hesitate to share them.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.