Created
May 24, 2020 10:20
-
-
Save surajsau/3073bc3810baca2fa986c20135bbba1b to your computer and use it in GitHub Desktop.
Applescript for storing the password mapping
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on writePassword(title, passwordString) | |
try | |
-- (1) | |
set textToBeWritten to "\n" & title & ":" & passwordString | |
-- (2) | |
set documentsPath to path to documents folder as text | |
set passwordFile to documentsPath & "password.txt" | |
set the logFile to ((path to documents folder) as text) & "password.txt" | |
try | |
-- (3) | |
open for access file the logFile with write permission | |
write textToBeWritten to file the logFile starting at eof | |
close access file the logFile | |
on error | |
try | |
close access file the logFile | |
end try | |
end try | |
on error errMsg | |
display dialog passwordFile & errMsg | |
end try | |
end writePassword |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment