Skip to content

Instantly share code, notes, and snippets.

@chrisgrande
Created January 19, 2022 20:37
Show Gist options
  • Save chrisgrande/2658219ca9aa6f47a408fb6926357aec to your computer and use it in GitHub Desktop.
Save chrisgrande/2658219ca9aa6f47a408fb6926357aec to your computer and use it in GitHub Desktop.
#!/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