@cvp awesome code, works like a charm 🙂 now I can choose a directory and get its URL, but.. I still can’t get it to list its content. I feel like I should use FileManager class for it (part of Foundation). I have completely no ObjC background, so I’m a little Daredevilling here, and here’s what I came up with in order to list the content of the chosen directory:
fileManager = ObjCClass("NSFileManager").alloc().init()
fileManager.contentsOfDirectoryAtURL_includingPropertiesForKeys_options_error_(param,[],4,None)
where param is the URL of the directory I got from your script. When I run the script it just crashes and Pythonista shuts down. Is python’s None type the equivalent of ObjC nil? I didn’t know how to pass enumeration options as the third parameter so I just put the default value there (based on the documentation). Could you help me with that as well?