-
-
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 ? '😃' : '🫤'; | |
} |
@zdravnick The systemwide insertion point doesn’t offer a block-type presentation style, so a feature like that would need to be implemented in the application itself or in a custom input method.
you're right. But I have no idea how to do this...
Thank you for taking the time to put this together. When I copy it in, I get the message
zsh: event not found: /usr/bin/env
And the caps lock feature still displays.
I'm very new to using the terminal window, and have no real history of monkeying around with such things.
After running this script, nothing happened. Now what can I do?
Hi Stephen,
I am hoping I can get your help with the recurrence of the dreaded thick cursor. I'm happy to pay for advice also. Somehow I inadvertently updated Pages to 14 and it's back - still no horrible caps lock notification, thankfully. I have your original script still in Script Editor and this file in Library/Preferences/FeatureFlags/Domain
redesigned_text_cursor Enabled Not sure if it is relevant but the JS script I have refers to kUIKit and file as above is called just UIKit - be grateful for any ideas - the OS is still Sonoma and it's tricky to go back to Ventura as is Apple chip
Hi, maybe somebody knows how to change the cursor to block in TextEdit (mac osX Sonoma). Thanks!