Created
May 24, 2020 10:22
-
-
Save surajsau/7001807f48fc56390f381c06a986bc61 to your computer and use it in GitHub Desktop.
Applescript for password retrieval from file
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 readPassword() | |
try | |
-- (1) | |
set logFile to (path to documents folder) as text | |
set theFolder to POSIX path of logFile | |
set passwordFile to theFolder & "password.txt" | |
-- (2) | |
open for access passwordFile | |
-- (3) | |
set fileContents to paragraphs of (read passwordFile) | |
close access passwordFile | |
return fileContents | |
on error errorMsg | |
return {} | |
end try | |
end readPassword |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment