Posts

Post not yet marked as solved
1 Replies
721 Views
In macOS 11 and earlier, I used to read Finder tags and their colors from the property list file ~/Library/SyncedPreferences/com.apple.finder.plist. In macOS 12, it seems that this file does no longer exist. Since there are no obvious changes to the list of tags in Finder > Preferences > Tags, which was (partly) based on the file above, I wonder whether the synced preferences file is gone for good, has been moved to a different location or has been deliberately made inaccessible? Is there an alternative way in macOS 12 to get the list of tags and their colors, apart from searching the entire file system using NSMetadataQuery? Thanks.
Posted Last updated
.
Post not yet marked as solved
1 Replies
504 Views
I'm using NSTokenField and a NSTokenFieldDelegate with its delegate methods completionsForSubstring, representedObjectForEditing, displayStringForRepresentedObject and shouldAdd tokens to display an array of Strings to the user for selection while typing in the NSTokenField. However, when confirming the current text input with Return key to "tokenize" it, the app crashes with[General] An uncaught exception was raised [General] *** -[NSBigMutableString substringWithRange:]: Range {1, 7} out of bounds; string length 2This happens on 10.14.6 as well as on 10.15.2 and Xcode 11.3. I've pasted the complete stack trace here: https://pastebin.com/u4J18hnBI noticed, when confirming the text input with a comma (the default tokenizing character), it doesn't crash. It still throws an exception, however, it is ignoring it. Additionally, the range in the console output seems to be related to the number of characters of the token, whereas the string length seems to be the number of tokens in the NSTokenField.: Exception(*** -[NSBigMutableString substringWithRange:]: Range {0, 9} out of bounds; string length 1) raised while processing typed text. Ignoring...There is also a StackOverflow issue from someone else discussing this but doesn't have any solution yet.Does anyone have an idea why the application is crashing and could possibly give hints in fixing or circumventing the issue?
Posted Last updated
.
Post not yet marked as solved
0 Replies
480 Views
Hi,in this particular case, I'm trying to modify com.apple.finder.plist which is located at ~/Library/SyncedPreferences/. I tried by using the CFPreferences API. However, CFPreferencesCopyAppValue and CFPreferencesCopyValue return both nil, e.g. for key FinderTags and appID com.apple.finder. If I use a key from ~/Library/Preferences/com.apple.finder.plist, such as FavoriteTagNames, reading it with CFPreferencesCopyAppValue works. Is there a way to point the CFPreferences API to the SyncedPreferences plist instead? Here is what I've tried in Playground:// 1. --> returns nillet appPref = CFPreferencesCopyAppValue("FinderTags" as CFString, "com.apple.finder" as CFString)// 2. --> returns nillet appPref = CFPreferencesCopyAppValue("FinderTags" as CFString, "~/Library/SyncedPreferences/com.apple.finder" as CFString)// 3. --> returns nillet appPref = CFPreferencesCopyValue("FinderTags" as CFString, "com.apple.finder" as CFString, kCFPreferencesAnyUser, kCFPreferencesAnyHost)// 4. --> returns nillet appPref = CFPreferencesCopyValue("FinderTags" as CFString, "~/Library/SyncedPreferences/com.apple.finder" as CFString, kCFPreferencesAnyUser, kCFPreferencesAnyHost)// 5. --> returns ["", "Red", "Orange", "Yellow", "Green", "Purple", "Gray"]let appPref = CFPreferencesCopyAppValue("FavoriteTagNames" as CFString, "com.apple.finder" as CFString)Cheers,Dennis
Posted Last updated
.