Created
January 7, 2011 17:13
-
-
Save dirkstoop/769757 to your computer and use it in GitHub Desktop.
quick and dirty way to see what NSWorkspace thinks a file's UTI is…
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 python | |
from AppKit import NSWorkspace | |
import sys | |
if __name__ == '__main__': | |
if not len(sys.argv) > 1: | |
print 'Usage: getuti path' | |
sys.exit(1) | |
else: | |
print NSWorkspace.sharedWorkspace().typeOfFile_error_(sys.argv[1], None)[0] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I wrote this little nugget at least 20 times, whenever I need to debug UTI-related stuff. Here so I hopefully remember it's here.
Usage: