Jump to content

rogerz

Member
  • Posts

    1
  • Joined

  • Last visited

Posts posted by rogerz

  1. On 1/21/2019 at 7:41 PM, gingerbeardman said:

    So I finally put together a workaround for this using UI scripting.

     

    https://www.gingerbeardman.com/alfred/Search Keychain.alfredworkflow

     

    1. Accept keyword and argument
    2. Launch Keychain Access via Alfred Workflow
    3. AppleScript focus search box, enter argument, copy password prompt, quit Keychain Access
    4. (user enter password and confirm)

    The core of it is the AppleScript:

    
    on alfred_script(q)
    	activate application "Keychain Access"
    	tell application "System Events"
    		tell process "Keychain Access"
    			set value of text field 1 of group 2 of toolbar 1 of window "Keychain Access" to q
    			click button 1 of text field 1 of group 2 of toolbar 1 of window "Keychain Access"
    			click menu item "Copy Password to Clipboard" of menu 1 of menu bar item "Edit" of menu bar 1
    		end tell
    	end tell
    	quit application "Keychain Access"
    end alfred_script

     

     

    I have to modify "group 2" to "group 1" to make it work on Mojave

×
×
  • Create New...