Created
January 19, 2022 20:37
-
-
Save chrisgrande/2658219ca9aa6f47a408fb6926357aec 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
#!/usr/bin/env python3 | |
from AppKit import NSWorkspace | |
def is_alias (path): | |
uti, err = NSWorkspace.sharedWorkspace().typeOfFile_error_( | |
os.path.realpath(path), None) | |
if err: | |
raise Exception(err) | |
else: | |
print(uti) | |
return "com.apple.alias-file" == uti |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment