system-preferences

Programmatically changing screen lock timeout

蹲街弑〆低调 提交于 2020-01-05 07:48:06
问题 In my Cocoa application I would like to access and change the computer's screen lock timeout setting. Changing it in System Preferences does not require the user to enter the admin password. Unfortunately I couldn't find any information in the documentation, and I'm not sure what topic I should look into (security settings / prefPane programming). Any help would be appreciated. 回答1: NSMutableDictionary* plistDict = [[NSMutableDictionary alloc] initWithContentsOfFile:@"/Users/new/Library

Using Swift with an OS X Preference Pane plugin

我们两清 提交于 2019-12-30 04:11:08
问题 I'd like to use Swift to build an OS X Preference Pane plugin for the System Preferences app, but I can't get it to work. After clicking "Next" the Xcode template doesn't offer an option to choose Swift as a language, but automatically creates the project in Objective-C. Without adding any code or doing anything else, the project builds successfully. If you right-click on the Product and select "Open in External Editor", System Preferences will successfully install and load the preference

Edit system preferences from cocoa

安稳与你 提交于 2019-12-12 10:10:45
问题 Is there any way to edit system preferences programmatically using cocoa? Is there some framework required? I need to do this to change the global proxy settings. Also, my app is sandboxed. Is there any sample code on how to do this? Thanks for your help. 回答1: You're looking for the System Configuration framework, but it's not going to be easy. I don't think it's possible for a sandboxed app, because it requires root privilege. (Just like you have to authenticate as an admin to modify

How to show American Sign Language (Hand Signs) on iOS Keyboard Keys?

↘锁芯ラ 提交于 2019-12-12 06:07:38
问题 I have to create a custom keyboard which support American Sign Language. For that I have to convert English language keyboard's keys symbols to American Sign language hand symbols keys. So how to translate (English Alphabets) to ASL- (Hand Sign) on iOS Keyboard. Look This: How to simulate a sign language keyboard in IOS? We have to do opposite of this. i.e Hand Signs on Keyboard. And when user press hand sign keys alphabets it's respected alphabet will show up in text editor. Hint: Sign

FinderSync check if extension is selected

匆匆过客 提交于 2019-12-09 11:47:36
问题 I am developing a FinderSync extension and I have some issues in checking if the selection is selecting, or selecting/deselecting the extension. Is there a way to programmatically check if a FinderSync extension is selected in System Preferences->Extensions ? Are there any API's to get notified when this selection changes? Is there any API to select/deselect an extension, beside using the following? system("pluginkit -e use -i com.mycompany.finderExt") Note that I have already visited these

Why does my Preference Pane seem to think it's always the wrong architecture?

允我心安 提交于 2019-12-08 18:04:56
问题 This has worked just fine for a long time. As far as I can tell from the diffs I haven't changed anything... but I'm not 100% sure. All I know is that now my preference pane shows this error when I try to open it: When I press OK, it restarts and shows the same dialog. This continues ad nauseam. I checked the binary with file and it confirms that it's a 64-bit executable: is-mbp-bleggiero:MacOS bleggiero$ file My\ App\ Preferences My App Preferences: Mach-O 64-bit bundle x86_64 This is...

change screen resolution with AppleScript

て烟熏妆下的殇ゞ 提交于 2019-12-08 06:35:51
问题 I am trying to click at radio buttons in Displays panel of System Prefernces, namely to change Screen resolution. This is the code I use to identify radio buttons: tell application "System Preferences" activate reveal anchor "displaysDisplayTab" of pane id "com.apple.preference.displays" end tell tell application "System Events" tell application process "System Preferences" set frontmost to true get every radio button of window 0 --click button 1 of window 0 of application process "System

Does anyone know where OSX stores the settings in System Preferences > Keyboard > Modifier Keys?

一个人想着一个人 提交于 2019-12-07 13:04:38
问题 I'm apparently not the only one who wants to know (How can I change modifier keys in "System Preferences > Keyboard > Modifier Keys..."). I've tried watching the System Preferences app with dtruss, but that doesn't seem to be possible on 10.10.3 (which is what I'm on right now), and I'm not even sure that that would be at all useful if System Preferences is just getting settings from cfprefsd. Watching cfprefsd with dtruss doesn't seem to catch the relevant file access. Does anyone know of an

change screen resolution with AppleScript

谁都会走 提交于 2019-12-06 22:52:28
I am trying to click at radio buttons in Displays panel of System Prefernces, namely to change Screen resolution. This is the code I use to identify radio buttons: tell application "System Preferences" activate reveal anchor "displaysDisplayTab" of pane id "com.apple.preference.displays" end tell tell application "System Events" tell application process "System Preferences" set frontmost to true get every radio button of window 0 --click button 1 of window 0 of application process "System Preferences" of application "System Events" --click radio button "Scaled" of radio group of window "com

Edit system preferences from cocoa

谁都会走 提交于 2019-12-06 04:08:29
Is there any way to edit system preferences programmatically using cocoa? Is there some framework required? I need to do this to change the global proxy settings. Also, my app is sandboxed. Is there any sample code on how to do this? Thanks for your help. You're looking for the System Configuration framework, but it's not going to be easy. I don't think it's possible for a sandboxed app, because it requires root privilege. (Just like you have to authenticate as an admin to modify settings in the Network pane of System Preferences.) See the System Configuration Programming Guidelines . Among