Get_safari_password with Keychain passwords [Solved]

taize
taize
Community Member
edited August 2021 in Mac

I ran the script yesterday and it was proceeding until I tried to do something on my laptop and the script stoped (I only realised later I should have let it run). Now when I run the script safari restarts but I don't get the password (preferences) window and get the error:

error "System Events got an error: Can’t get group 1 of window 1 of application process \"Safari\". Invalid index." number -1719 from group 1 of window 1 of application process "Safari"

I've rebooted, restarted safari and the script error with no success

1Password 7
Version 7.8.7 (70807004)
1Password Store

MacOS 11.5.1

safari 14.1.2


1Password Version: Not Provided
Extension Version: Not Provided
OS Version: Not Provided

Comments

  • MrC
    MrC
    Volunteer Moderator

    Hi @taize

    Quit Safari and Quit Script Editor. Be sure they are both Quit (not just closed windows). Once this is done, double-click the script to have it open Script Editor. Then run it. It will launch Safari and should do the right thing.

    Most users have their apps automatically re-open after restart / login and they retain some state (and this may be what's happened to you). Once these two apps get into this state, for some reason the script has trouble controlling Safari. So be sure both Quit both.

    See if this helps.

  • taize
    taize
    Community Member
    edited August 2021

    @MrC Unfortunately quitting both safari and the script editor as you suggested did not resolve the issue. I rebooted and checked using activity monitor and there were no safari processes running - same error message

  • MrC
    MrC
    Volunteer Moderator

    I'm not sure what to advise then, @taize.

    It's critical that the script be allowed to do its work without interruption. The error you see typically has occurred when users tried to use the Mac at the same time that the script was running. And due to the way the AppleScript is targeting systems dialogs and windows, it needs to control the user interface during that time.

    Does your Mac have anything that might be interfering with this, or changes the user interface in some way?

  • taize
    taize
    Community Member

    @MrC What is really odd is the script worked perfectly the first time I ran it. I interrupted it and since then it has not worked. Could there be something with safari that is blocking the script? Would booting to safe mode help?

  • MrC
    MrC
    Volunteer Moderator

    @taize,

    I''m trying to think of reasons why you'd see this.

    You did set the Accessibility settings like as shown below, right?

    You can try Safe Mode, don't know if that will help / hurt.

    I just ran the script twice in a row, and it ran to completion (an up to date system).

    Is your system fairly old, and slow? The script waits for Safari to do its work, but perhaps there is still a timing issue for your system.

  • MrC
    MrC
    Volunteer Moderator
    edited August 2021

    Do you get a Log file on your Desktop?

  • taize
    taize
    Community Member

    @MrC Its all working now. I re-downloaded the conversion suite and ran the newly downloaded script and it worked perfectly. I'm not sure how the original one got corrupted. Thanks for your quick support.

  • MrC
    MrC
    Volunteer Moderator

    Outstanding @taize ,

    Sometimes these little life-successes are to be simply enjoyed, if never understood. :-)

    Enjoy 1Password!

  • sarapova
    sarapova
    Community Member

    Same error on Safari 15.0 and macOs 10.15.7. Any suggestion?

  • MrC
    MrC
    Volunteer Moderator
    edited October 2021

    @sarapova

    Safari 15 now allows you to export its passwords as CSV. Open the password tab in Safari preferences, enter your password, and then click the gear icon at the bottom, and select Export Passwords... You will be asked to enter your Mac's password to continued. Enter it, and name the resulting CSV file.

    With this new feature in Safari 15, there's no reason to use the Get_Safari_Passwords script anymore.

  • sarapova
    sarapova
    Community Member

    Thank You!

  • ag_ana
    ag_ana
    1Password Alumni

    On behalf of MrC, you are very welcome :)

This discussion has been closed.