How to change system preferences programatically, 10.5 issue

I know about the "preferences" api. Like SCPreferencesCreate(NULL, CFSTR("SomeName"), NULL);
and get value and all the rest.
In fact, I know how to read all the preferences.
The problem is changing them. I do not care which one, any of them. You see, these are on "const" or non-mutable. So you are going through a dictionary and want to add a value. So you use CFDictionaryAddValue(..).
On 10.4, this is fine. On 10.5 is crashes with an error (the newer XCode is much nicer) saying I am trying to add a mutable value to a non-mutable collection. So any CFDictionary is non-mutable. I can create a mutable copy, and do whatever I want, but I can't save the changes into the original preferences file because its non-mutable. Now I can of course create a non-mutable value, like a CFArray or whatever, but the CFDictionaryAddValue(..) only takes Mutable items.
This seems to be a catch-22 situation.

The problem was this. You would Start with PrefGetValue getting "A", but needing to change "C"
A
--B
----C
So you can get and set A, but it is C that needs to be altered.
I figured it out and it was a solution I kind of suspected, but didn't want to deal with, because what if you wanted something really deep like H or Z or whatever.
What you do is Get A, make a mutable copy of A. Then get B (from mutable A) and make a mutable copy of that, and repeat until you were at the thing you wanted to change. Then you change it, then rebuild the dictionary structure in reverse. SetValue C, then Set mutable B's value to Mutable C's value, then set Mutable A's value to Mutable B's value, and finally use SetPref using Mutable A instead of the original A.
Apparently 10.4 didn't consider the prefs non-mutable so everything had worked, and under 10.5, they are non-mutable and you crash if you try and change it.

Similar Messages

  • How to change system administrator for os x 10.9.1

    how to change system administrator for os x 10.9.1

    sriharshasanne,
    log in as your current system administrator and open the Users & Groups pane of System Preferences. If the padlock in the lower-left corner is locked, click on it to unlock it. Click on the “+” button above the padlock to create a new user; set the “New Account” dropdown to “Administrator”. Provide the missing text box information, and press the Create User button. After the new administrative user has been created, exit System Preferences, log out, and log in as the new system adminstrator. Open the Users & Groups pane of System Preferences again, select your old administrative user, select its Password tab, and uncheck its “Allow user to administer this computer” checkbox. Relock the padlock if desired, and exit System Preferences.

  • How to change system time through java program

    Hi
    I want to know, how to change system time through java program.
    give me a idia with example.
    Thanks

    There isn't any core Java API for this. Use JNI or call an external process with Runtime.exec().
    ~

  • How to change system time on Cisco MeetingPlace Express Server

    How to change system time on Cisco MeetingPlace Express Server
    Model MCS-7825-I4

    Hi Vijay,
    As per the install guide for MPX 1.x as well as 2.x "Caution! Be sure you enter the correct date and time. You must reinstall the Cisco Unified MeetingPlace Express operating system and application if you need to change the date or time of your server in the future."
    http://docwiki.cisco.com/wiki/Cisco_Unified_MeetingPlace_Express,_Release_2.x_--_Configuring_the_Cisco_Unified_MeetingPlace_Express_Server#Configuring_the_Cisco_Unified_MeetingPlace_Express_Server
    http://www.cisco.com/c/en/us/td/docs/voice_ip_comm/meetingplace_express/1_2/english/installation/guide/iug/mpxinst3.html
    HTH
    Manish

  • How to Check System Preference Settings with Time Machine

    I just found and fixed a problem caused by a bad System Preference/Universal Access
    setting and would like to go back in my Time Machine backup to see where the
    error was made. I may have been too quick to blame the 10.5.3 update on the
    problem so wanted to look back in time.
    The problem is i don't know how to check System Preferences using the Time Machine.
    Any suggestion?

    If you're looking for specific settings, the short answer is you cannot. You can open the .plist files and try to find the specific option you're looking for, though it might not be too easy to decipher some of the contents of the .plist file. For the most part they're just lists of attributes and settings. For instance, here's a very small chunk of my Finder .plist file:
    <key>All Images.cannedSearch</key>
    <dict>
         <key>SidebarWidth</key>
         <integer>162</integer>
         <key>ToolbarVisible</key>
         <true/>
         <key>ViewHeight</key>
         <integer>1116</integer>
         <key>ViewStyle</key>
         <string>icnv</string>
         <key>WindowBounds</key>
         <dict>
              <key>bottom</key>
              <integer>1200</integer>
              <key>left</key>
              <integer>56</integer>
              <key>right</key>
              <integer>1920</integer>
              <key>top</key>
              <integer>84</integer>
         </dict>
    </dict>
    <key>AnimateInfoPanes</key>
    <true/>
    <key>AnimateSnapToGrid</key>
    <string>true</string>
    <key>AnimateWindowZoom</key>
    <true/>
    Each "key" is followed by an attribute, so for instance the "SideBar Width" key is given the "Width" integer attribute of 162. However, some keys have multiple entries, such as the "WindowBounds" key having sub-keys of "bottom", "left", "right", and "top".
    These values are finder preferences, though are not accessible via the finder's preference settings. However, buried deep in the Finder's .plist file are some of the user-editable settings:
    <key>ShowHardDrivesOnDesktop</key>
    <true/>
    <key>ShowMountedServersOnDesktop</key>
    <true/>
    <key>SidebarSearchesSectionDisclosedState</key>
    <false/>
    If you can find the attribute you're looking for, then that may help you narrow down which version of a .plist file to restore, though not all of them are straightforward legible text. Some have bizarre strings of seemingly random characters that only the application can interpret.
    Message was edited by: Topher Kessler

  • Does anybody know how to reinstall System Preferences? I accidentaly put System Preferences in the trash and emptied the trash :P

    Does anybody know how to get System Preferences? A couple of weeks ago I put it in the trash and emptied it. Does anyone know how to reinstall it?

    How Restore Deleted or Missing OS X Components
    A few of the basic OS X installed applications can be restored from the Optional Installs installer located in the Optional installs folder on your Installer DVD.  However, if what you need is not there then follow the instructions below.
    How to Use Pacifist to Restore Deleted or Missing OS X Components
    Insert the OS X Installer DVD into the optical drive.  Use a simple utility like TinkerTool to toggle invisibility so you can see invisible items.  Alternatively, open the Terminal application in your Utilities folder and at the prompt enter the following:
    defaults write com.apple.finder AppleShowAllFiles Yes
    Press RETURN.
    To turn off the display of invisible files repeat the above command substituting No for Yes.
    The install packages are located in the /System/Installation/ folder on the DVD.
    Download the shareware utility Pacifist. Use it to extract a fresh copy of the missing item(s) from the file archives on your OS X installation DVD. The file archives are in the /System/Installations/ folder (use Go to Folder option in the Go menu of the Finder.)
    Here are Four Basic ways to use Pacifist (courtesy of George Orville.)
      A. Drag a .pkg icon onto the Pacifist window .....proceed to step 7.
      B. Click on “Open Package ....” and navigate to package desired and click “Open” in
           the open/save window.....proceed to step 7.
      C. Insert Mac OS X installer CD and when it mounts, navigate to .... Menu->Go->Go
           to Folder. In the path field enter or paste ....
    /Volumes/disc name/System/Installation/Packages (where disc name is the name of the CD/DVD that you inserted.)
    Click on the  "Go" button ..... • Drag a .pkg to Pacifist..... proceed to step 7.
    The package you'll need will have to be discovered by trial and error, but for most applications you should start with the Essentials.pkg and/or Additional Essentials.pkg.
    D. Insert your Mac OS X install disk 1 .... and open Pacifist.
    1. In Pacifist, select "Open Mac OS X Install Packages" ... dialog may appear asking for disk 2, then disk 3 and finally disk 1 again.... {if DVD is not used)...If “Stop Loading” is selected...the procedure will stop!!!
    2a. When loading is complete, a new window appears, click the triangle to display contents of each package...Select item and proceed to step 7.
    2b. or click the “Find” icon in the Pacifist window and type the name of the software you need.
    3. In the list that comes back, click the top most entry for the item that you want. ..... that is the one for the English language.
    4. On the top of the Pacifist window, click “verify” .... you will probably be prompted for your password.
    5. Enter checks for.... “verify permissions” and “verify file contents.” and click “verify” ....enter password when prompted.... you will get back output which may look like this:
      20 files were scanned. 20 of 20 files were present on the hard disk. 0 of 20 files had file permissions that did not match those specified in the package. 0 of 20 files had checksums that did not match those specified in the package.
    6. Click “close”. Go to step 7.
    Extract or Install........
    7. In the Toolbar (upper left), you now have the option to extract or install. Click a file in the lower list and those two icons will be enabled.
    8. If “Extract to...” is selected.... navigate to the location where the file will be placed, select “choose”, select “extract” in new dialog that appears,authenicate , if prompted, click “OK”.
    9. In the next dialog, click “Extract”.
    10. If “Install” is selected... dialog will appear with the location/path of the installed software. Click “Install”
    11. Type in your password, click “OK”
    Pacifist will begin to extract files.
    12. In steps 8/10ß.... you also have the choice to “cancel”
    Notes: Pacifist may find that a file it is installing already exists on the hard disk. Pacifist will present you with an alert panel....
      • Stop
      • Leave original alone
      • Update .....
      • Default selection
      • Replace .... (Replace option should only be used on full install packages)

  • Can't install Adobe flash cuz  I don't know how to close   "system preferences"

    CAN'T INSTALL   ADOBE  FLASH PLAYER  CUZ  I  DON'T KNOW HOW TO CLOSE  SYSTEM PREFERENCES  ON MY  MAC  !!!

    Open your Linux distribution's package manager and install Flash Player from there.
    * https://help.ubuntu.com/community/RestrictedFormats/Flash
    The following support article lists alternative installation methods.
    * [[Install the Flash plugin to view videos, animations and games]]
    If you continue having problems, please describe exactly what steps you've taken and what went wrong (error messages, if any).

  • How to change printer preferences for HP envy 4500 using Google Chromebook HP pavilion 14

    I want to know how to change printer preferences for HP envy 4500 using Google Chromebook HP pavilion 14?
    This question was solved.
    View Solution.

     Hi chefcorbin,
    Welcome to the HP Support forums.  I understand that you would like to learn how to change the printer preferences using your Chromebook.
    I have included a link to Google support on printing a page with Chrome and it lists the print settings that you can adjust.
    Google Chrome Help - Print a Page
    Regards,
    Happytohelp01
    Please click on the Thumbs Up on the right to say “Thanks” for helping!
    Please click “Accept as Solution ” on the post that solves your issue to help others find the solution.
    I work on behalf of HP

  • How to change System Input Method ?

    I tried to write multilingual program.
    I have system input method and specific input method code (lib/ext).
    How to change System Input Method from a code ?
    or
    How to handle an event when i chage system input method in the Windows.
    (My OS is Windows XP).
    I tried to do (for example):
    java.awt.im.InputContext ic = this. getInputContext ();
    ic.selectInputMethod(new Locale ("ru"));
    It doesn't help.

    up

  • How to restore System Preferences's lock icon?

    How to restore System Preferences's lock icon? My Mac's System Preferences's lock icon at the  lower left corner disappeared, how to restore?

    The solution is in this 5 Feb 2014 post by Dio Gratia:
    "Go to the Security& Privacy System Preferences Pane, click the lock icon, authenticate and hit the Advanced button.  Check the Require an adminstrator password to access system-wide preferences, hit Okay.
    The lock icon will show up again on the Sharing Preference Pane.  It should cure the missing lock icon in general."
    See
    Re: No lock in the preference pane???

  • How do load system form matrix -Inventory-Goods Issue through SDK UI &DI

    While I am accessing system form matrix -Inventory Goods Issue/ Goods Receipt, the matrix object is not accessible.
    Error is coming stating "Item 13 is invalid, where 13 is item uid for matrix.
    So,How do load system form matrix -Inventory-Goods Issue(FORM 720/-720) through SDK UI &DIAPI.
    Form Type: -720
    How to get reference of System form matrix object -Inventory-GoodsIssue.
    Some thing similar to CopyFrom functionality for -Inventory-Goods Issue.
    Currently my client requirement is as follows.
    I created a UDF ((U_ILC) Incoming Log Challan) for marketing documents. And, this field is added in the header level of Goods Reciept, Goods Issue documents.
    1. Through Inventory->Goods Receipt (ILCNo.10), items are received. Assume, M00001, M00002 are the items received with qty, price, whse, account values.
    2. Through Inventory->Goods Issue, item should be issued. In this Goods Issue Form, after entering U_ILC value as 10, pressing Tab, the GoodsIssue matrix should be loaded with the values of GoodsReceipt(IGN1 for U_ILC:10) document i.e. M00001,M00002 along with the same values as in GoodsReceipt of ILC:10.
    The code is as follows:
    If (( ( pVal.FormType = "-720" or pVal.FormType = 720) And pVal.EventType <> SAPbouiCOM.BoEventTypes.et_FORM_UNLOAD) And (pVal.Before_Action = False)) Then
                '// get the event sending form
                oForm = SBO_Application.Forms.GetFormByTypeAndCount(pVal.FormType, pVal.FormTypeCount)
                If pVal.ItemUID = "U_ILCNo" And pVal.EventType = SAPbouiCOM.BoEventTypes.et_LOST_FOCUS And pVal.Before_Action = False Then
                    SBO_Application.MessageBox("ILC No. Lost Focus")
                    oMatrix = oForm.Items.Item("13").Specific
                    oColumn = oForm.Columns.Item("1")
                    oEditItmCode = oColumn.Cells.Item(1).Specific
                    oEditItmCode.Value = "07215090x606"
                    oItem = oForm.Items.Item("U_ILCNo")
                    oEdit = oItem.Specific
                    SBO_Application.MessageBox(oEdit.String)
                End If
            End If
    3. The code
    oMatrix = oForm.Items.Item("13").Specific
    is raising error. I have used Event Logger and breakpoints to see where the code is halting.
    Help me, how to access the matrix of Goods Receipt/ Goods Issue and load based on the existing data.
    Thanks in advance

    HI
    If your code is in the SBO_Application_ItemEvent then try using this line
    oForm = SBO_Application.Forms.Item(strFormUID)
    instead of
    oForm = SBO_Application.Forms.GetFormByTypeAndCount(pVal.FormType, pVal.FormTypeCount)

  • How to set system preferences globally?

    Hello!
    I am trying to change preferences for all users who log into a system. For example, I want the screen saver to timeout at 10 minutes and require a password immediately after the screensaver starts. When a new user is logged in, this defaults back to 15 minutes and not to require a password after the screensaver is active.
    I have modified the default user 'profile' but the settings do not stick for new users. How can I force settings in System Preferences to apply to all accounts, current and future? These systems are in an enterprise environment, but since they account for 0.001% of our entire system inventory, we do not run Open Directory and they will not be managed via AD. I would like to configure them as locally (and simply, most technicians here have no experience with OSX) as possible.
    Thanks for any and all input!

    Creating a new user account on the machine requires a Admin account, so while there, set everything else up too and create a cheat sheet to expidite the process later.
    Mac's are consumer machines, not for enterprise level use, they allow a certain degree of personalization.
    Even in General User one is allowed to change the Desktop background and screensaver time.
    If you want to lock the machines down. use something like DeepFreeze and set a nightly shutdown time and morning reboot. Everything will be set back to what you set it up like.
    Apple uses that on their store machines, save files to NAS or external.
    After awhile the users will avoid making changes to their machine and of course hate your guts.

  • How to modify System Preferences dialogue box text.

    I know that to change any dialogue box for the finder the path is Devices (name of your device) > (drive name) > System > Library > CoreServices > Finder.app  > Contents > Resources > English.lproj. If you open that file with Text Wrangler you can modify any finder message to whatever you want it to be, my question is how can you do the same thing but for the System Prefrences application? I don't know what path to follow for that. Thank you for any possible assistance!

    I'm specifically trying to modify the dialogue box that appears when you want to modify (add or delete) user accounts in System Prefrences "System Preferences is trying to unlock Users & Groups preferences. Type your password to allow this." However I can't seem to find it in either the Finder or System Preferences English.lproj files. Where else might I look? Or do you think I just missed it?

  • Remotely changing System Preferences via Firewire?

    Hi all,
    I've got an old mac mini and a new Mac book. The trick is, I've just moved overseas and don't have a monitor for the mini any longer. I have bought a cable to connect it to my tv, but I'm afraid the tv is too old, and won't play nice with the mini! Of course I cannot afford a new monitor either!
    My goal is to set up the Mini as a home server for my MacBook and a windows machine. To do so I need to adjust all of three settings. The trick is, I can't figure out how to get in to change the preferences in order to make this possible.
    I can start the Mini in Target disc mode, but of course cannot install any screen sharing software, etc. remotely. Does anyone have any ideas on how I could get access to the mini's System Preferences? Could I do that through Terminal? Boot camp?
    Thanks in advance for any suggestions!
    JakeOle

    Hi Jake, and Welcome to the Discussions!
    You could change the Sharing settings in...
    Mini's /Library/Preferences/com.apple.sharing.firewall.plist
    You'd likely have to use Terminal to reset the Permissions on it after saving it again though.
    The Mini is pretty portable... know a friend with a Monitor?

  • Changing system preferences automatically

    When I use a mouse with my mac I like "scroll direction: natural" turned off and I like to enable hot corners. I was wondering If I could create an app via Automator or AppleScript that I could click that would set up my computer for either mouse or trackpad use. I don't know if there are terminal commands for the the things I want to do, and if someone knows them, or knows where I can find them, that would be nice. Another thing I wanted to try was make an AppleScript that opened up system preferences and just clicked in the right spots to change my settings and then closed system preferences, but I couldn't get the click command to work ("System Events got an error: Can’t make {x, y} into type list."). If someone knows how to do this one of the ways I mentioned, or some other way, please let me know.

    "pages automatically upload when i turn on my mac"
    Go to System Preferences > General and uncheck the box dealing with "Restoring Windows ...." Read here about "Resume."

Maybe you are looking for

  • How to Setup Airport Time Capsule 802.11AC on Verizon fios

    I just got an Airport Time Capsule 802.11AC and i would like to set it up on to my existing verizon fios router as you can't change their router as the cable box works with it does anyone know how to do such a thing?

  • 2 Monitors w/ VGA cables

    I'm trying to hook up 2 monitors with ADC-VGA adaptors. Is there an adaptor for the other monitor output on the back of my G5 or is there another way to make them both work for more desktop space? It is a Sony flatscreen and a VGA monitor, both with

  • F.13 is a standard program for automatic clearing?

    f.13 is a standard program for automatic clearing? can i include plant code to the standard program.....and it is used for display clearing......need information?

  • Changes required for Migration from CR 8.5 to CR 11

    Dear All,   We have successfully migrated all the reports which were created in CR 8.5 to CR 11. But those same reports developed in CR 8.5 are called through .exe which has been built with Microsoft Visual Studio .NET 2003. The old reports of CR 8.5

  • Lsmw transport error

    Hi All, LSMW is working absolutely fine in dev, but after exporting and importing it to Q, LSMW is giving the error when I run the convert data, but it still works fine till display read data in Q. I am getting this error :SAP_LSMW_CONV_00000001 Than