Created
July 8, 2020 23:05
-
-
Save t-lark/35366441efd6e5cc2adaf4c28355eedf to your computer and use it in GitHub Desktop.
This file contains 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
#!/opt/bin/snowflake/python | |
""" | |
quick example code to grab what iCloud account is in use | |
""" | |
# import modules | |
from SystemConfiguration import SCDynamicStoreCopyConsoleUser | |
from CoreFoundation import CFPreferencesCopyAppValue | |
from Foundation import NSHomeDirectoryForUser | |
# global vars | |
USER, UID, GID = SCDynamicStoreCopyConsoleUser(None, None, None) | |
USERHOME = NSHomeDirectoryForUser(USER) | |
FILE = USERHOME + '/Library/Preferences/MobileMeAccounts.plist' | |
results = CFPreferencesCopyAppValue("Accounts", FILE)[0]['AccountID'] | |
print(results) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment