-
-
Save stephancasas/236f543b0f9f6509f5fe5878de01e38a to your computer and use it in GitHub Desktop.
#!/usr/bin/env osascript -l JavaScript | |
const App = Application.currentApplication(); | |
App.includeStandardAdditions = true; | |
const kCFPrefsFeatureFlagsDir = '/Library/Preferences/FeatureFlags/Domain'; | |
const kCFPrefsFeatureEnabledKey = 'Enabled'; | |
const kUIKitDomainPrefsTemporaryPath = '/tmp/UIKit.plist'; | |
const kUIKitRedesignedTextCursorKey = 'redesigned_text_cursor'; | |
function run(_) { | |
const dict = $.NSMutableDictionary.new; | |
const enabled = $.NSMutableDictionary.new; | |
enabled.setValueForKey(false, kCFPrefsFeatureEnabledKey); | |
dict.setValueForKey(enabled, kUIKitRedesignedTextCursorKey); | |
const error = $(); | |
dict.writeToURLError( | |
$.NSURL.fileURLWithPath(kUIKitDomainPrefsTemporaryPath), | |
error, | |
); | |
if (typeof error.js != 'undefined') { | |
return `🫤: ${error.localizedDescription}`; | |
} | |
return App.doShellScript( | |
[ | |
`mkdir -p '${kCFPrefsFeatureFlagsDir}'`, | |
`mv '${kUIKitDomainPrefsTemporaryPath}' '${kCFPrefsFeatureFlagsDir}'`, | |
].join(' && '), | |
{ | |
administratorPrivileges: true, | |
}, | |
).length == 0 ? '😃' : '🫤'; | |
} |
Yes, 2 times. I have Sonoma 14.3.1
@MrRod Not at the moment. I've had some pressing issues with work that needed attention. I'll update the Reddit post and sent a post on X when something's ready to be published.
@jorjGizer Run cat /Library/Preferences/FeatureFlags/Domain/UIKit.plist
and please paste the output here.
@MrRod Not at the moment. I've had some pressing issues with work that needed attention. I'll update the Reddit post and sent a post on X when something's ready to be published.
Thank you for your answer, I'll keep an eye on both Reddit and X :)
@jorjGizer That looks correct. What might be causing an issue is the file ownership. I'm not certain, but I think that root
needs to be the owner for the file to take effect — such is the way that launchd
handles certain property lists, too. Try changing ownership with:
sudo chown root /Library/Preferences/FeatureFlags/Domain/UIKit.plist
Hi, maybe somebody knows how to change the cursor to block in TextEdit (mac osX Sonoma). Thanks!
@jorjGizer Did you reboot your Mac?