Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

how do I print a list of Safari passwords?

OSX El Capitan version 10.11.5

Safari version 9.1.1

I want to print out a list of passwords in Safari so I may change out the weak ones for stronger suggested passwords.

Posted on May 31, 2016 8:31 AM

Reply
Question marked as Best reply

Posted on Dec 10, 2017 1:50 PM

Perhaps an AppleScript might work. No promises. You will have to format the resulting text file to make good use of the tabs.


--Best to name this AppleScript "Safari Passwords.scpt", which *MUST* be run from:

--/Users/<userid>/Library/Scripts/Applications/Safari/Safari Passwords.scpt

--Open [Safari]>[Preferences…]>[Passwords] and authenticate to unlock Safari passwords.

--This AppleScript *MUST* see the Preferences window, and it *MUST* be unlocked.

--Click AppleScript icon in the menu bar, select this AppleScript and wait... a lot...

--I have thousands of web addresses so I added a "tell me to say" as a status, which

--tracks when this AppleScript is on every 20th row.

--You can delete the status "tell me to say" or change it to 50, or 100.


on run

set current_date to (get current date)

set path_to_desktop_folder to ((get path to desktop folder from user domain) as text)

set name_of_me to "Safari Passwords" --(get name of me)

set passwords_file_txt to (path_to_desktop_folder & name_of_me & ".txt")

set passwords_text to (name_of_me & " as of " & current_date & return)

tell application "System Events" to tell application process "Safari"

if (exists window "Passwords") then

tell window "Passwords"

tell group 1 to tell group 1

tell scroll area 1 to tell table 1

set count_of_rows to (get count of rows)

repeat with int_row from 1 to count_of_rows

set (selected of row int_row) to true

tell row int_row

set this_address to (get value of text field 1)

set this_user_name to (get value of text field 2)

if (this_user_name is equal to "") then -- null value

set this_user_name to ("<user name>")

end if

set this_password to (get value of text field 3)

end tell

set passwords_text to (passwords_text & return & this_address & tab & this_user_name & tab & this_password)

if ((int_row mod 20) is equal to 0) then

tell me to say (int_row as text)

end if

end repeat

end tell

end tell

end tell

end if

end tell

tell application "Finder"

if (exists (file passwords_file_txt)) then

move file passwords_file_txt to trash

end if

end tell

try

close access (file passwords_file_txt)

end try

set file_open to (open for access (file passwords_file_txt) with write permission)

set eof file_open to 0

write passwords_text to file_open as text

close access file_open

tell application "Finder"

open (file passwords_file_txt)

end tell

end run

6 replies
Question marked as Best reply

Dec 10, 2017 1:50 PM in response to hogmike

Perhaps an AppleScript might work. No promises. You will have to format the resulting text file to make good use of the tabs.


--Best to name this AppleScript "Safari Passwords.scpt", which *MUST* be run from:

--/Users/<userid>/Library/Scripts/Applications/Safari/Safari Passwords.scpt

--Open [Safari]>[Preferences…]>[Passwords] and authenticate to unlock Safari passwords.

--This AppleScript *MUST* see the Preferences window, and it *MUST* be unlocked.

--Click AppleScript icon in the menu bar, select this AppleScript and wait... a lot...

--I have thousands of web addresses so I added a "tell me to say" as a status, which

--tracks when this AppleScript is on every 20th row.

--You can delete the status "tell me to say" or change it to 50, or 100.


on run

set current_date to (get current date)

set path_to_desktop_folder to ((get path to desktop folder from user domain) as text)

set name_of_me to "Safari Passwords" --(get name of me)

set passwords_file_txt to (path_to_desktop_folder & name_of_me & ".txt")

set passwords_text to (name_of_me & " as of " & current_date & return)

tell application "System Events" to tell application process "Safari"

if (exists window "Passwords") then

tell window "Passwords"

tell group 1 to tell group 1

tell scroll area 1 to tell table 1

set count_of_rows to (get count of rows)

repeat with int_row from 1 to count_of_rows

set (selected of row int_row) to true

tell row int_row

set this_address to (get value of text field 1)

set this_user_name to (get value of text field 2)

if (this_user_name is equal to "") then -- null value

set this_user_name to ("<user name>")

end if

set this_password to (get value of text field 3)

end tell

set passwords_text to (passwords_text & return & this_address & tab & this_user_name & tab & this_password)

if ((int_row mod 20) is equal to 0) then

tell me to say (int_row as text)

end if

end repeat

end tell

end tell

end tell

end if

end tell

tell application "Finder"

if (exists (file passwords_file_txt)) then

move file passwords_file_txt to trash

end if

end tell

try

close access (file passwords_file_txt)

end try

set file_open to (open for access (file passwords_file_txt) with write permission)

set eof file_open to 0

write passwords_text to file_open as text

close access file_open

tell application "Finder"

open (file passwords_file_txt)

end tell

end run

May 31, 2016 3:48 PM in response to hogmike

hogmike wrote:


OSX El Capitan version 10.11.5

Safari version 9.1.1

I want to print out a list of passwords in Safari so I may change out the weak ones for stronger suggested passwords.


Copy/paste them to a TextEdit/Word/Pages document and then print them off from there. Go to Safari Preferences --> Passwords. Click on one site, then press Command + A. This selects them all. At the bottom, click "Show passwords for selected websites." You may be asked for your administrator password. From there, you can open up a word processing program and type out each website/login name/password and print them off.

May 31, 2016 3:55 PM in response to hogmike

Pinkstones, I was able to use the information that you provided to highlight all of the passwords.. Is there any way that I can use the copy feature to transmit all of the passwords to Pages at one time? I'm not well versed in MAC command/control functions. The Windows right click/copy doesn't work to copy all the passwords to Pages.

Jun 1, 2016 9:22 AM in response to hogmike

hogmike wrote:


Pinkstones, I was able to use the information that you provided to highlight all of the passwords.. Is there any way that I can use the copy feature to transmit all of the passwords to Pages at one time? I'm not well versed in MAC command/control functions. The Windows right click/copy doesn't work to copy all the passwords to Pages.


No. You have to manually type everything out if you want to print off a list of all the passwords. As Rysz pointed out however, if you want to change passwords that are too weak so that they're stronger, just open a new tab and go to each website and change the passwords that way, writing them down (or typing them out) as you go along.

Aug 12, 2016 2:19 PM in response to hogmike

Hi hogmike, One step that can make this a little easier is to use screen prints.

I highlight all, then click on show passwords.

Then I Shift-Command-4 and get a screen print of the 12 passwords showing.

I scroll down and have 30 pages of passwords so 30 screen prints.

I then put those into a document and print out.

It makes it easier to use paper and pencil to work out a strategy for passwords.

I have not tried using OCR on my document to turn the screen prints into text but that might be worth a try.

Mostly I use this printout as a way to keep something in my lock box if there is ever an emergency.

I hope that helps.

how do I print a list of Safari passwords?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.