Post

Replies

Boosts

Views

Activity

What are the available NSSortDescriptors for PHFetchOptions?
I'm working with Apple's sample code for PhotoBrowse. In the main view controller's viewDidLoad() method we have this code: let allPhotosOptions = PHFetchOptions() allPhotosOptions.sortDescriptors = [NSSortDescriptor(key: "creationDate", ascending: true)] This code sorts the photos by "creationDate". How do I determine/find the other valid values for these sort descriptors? For example, what if I wanted to sort photos by their file size, last modified date, etc.? TIA!
2
0
868
Aug ’23
Is there a technical reason why Photos.app/PhotoKit does not support displaying file sizes?
It is 2023 and Photos.app still provides no way to sort photos/movies by file size. I ended up writing some AppleScript that displays the file sizes of images/movies in a specific album. It is also simple to create a shell script to examine the photo library contents directly but mapping the UUID-based filenames back to the names used in Photos.app is not straightforward (to me at least). You can't even create a smart album based upon file size. Why is there no native support for this in Photos.app/PhotoKit? (And, yes, I have submitted many feature requests over the years)
0
0
545
Aug ’23
SIP blocks read access to the /Users/Library/Bob/Mail folder
I wrote a Python script that iterates over all the "Junk.mbox" folders in my account (/Users/Bob/Library/Mail). My account, Bob, is an admin account. Even if I run my script with sudo, the script fails with a permissions error. I manually checked ALL of the folders (recursively) in /Users/Library/Bob/Mail and they all have read/write access for my account. I wondered if it was SIP related so I disabled it. And, yes, I can access that folder programmatically with SIP disabled. So I re-enabled SIP and simply copied the contents of /Users/Bob/Library/Mail to ~/tmp. Now my Python script runs without issue when pointing to that folder. Please tell me that I don't have to disable SIP or copy gigabytes worth of data to another location just to access my own email data. Any suggestions would be greatly appreciated!
2
0
686
Mar ’24