Changing System Preferences

I work in an office at a university which maintains all the teaching classroom computers, and we periodically reinstall OS X and generally refresh all our Macs once (or more) a year from a custom-made image which has all of the proper software set up, etc. There are a lot of computers, and it's a pretty time consuming process, so I thought it would be helpful to create an Applescript that automatically fills all the network settings back in through System Preferences instead of doing each one manually. I've only just started learning Applescript, and while I'm pretty sure this can be done, I'm just not sure how. I've read through tons of tutorials, but I can't come up with a solution.
I have been using Xcode to create a nice interface, and what I would like to do is create a drop-down list of all the classrooms, so whoever is running the Applescript can choose a room from the list and the script will change the computer's IP and network settings. I have gotten as far as making System Preferences open up and change to Network settings, but beyond that I am having trouble. I need to know how I can get Applescript to modify the text fields in the Network pane. I have tried many different methods for this, but I can't seem to come up with one that actually works.
Can someone tell me (or point me in the direction of a good tutorial) how to modify the contents of text fields with Applescript? I think I can figure the rest out once I get past this little hurdle, but meanwhile it's driving me crazy. Thank you in advance.

> Can someone tell me (or point me in the direction of a good tutorial) how to modify the contents of text fields with Applescript?
I'd recommend a different approach.
While it is possible to modify text files via AppleScript, if you're manipulating preferences you should familiarize yourself with the defaults command.
defaults gives you command line access to the preferences system. You may need to do this anyway since many preference files are moving to a binary .plist file rather than text files.
man defaults will give you the basics. You can invoke this via AppleScript's do shell script command if you want an AppleScript solution.

Similar Messages

  • 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."

  • Using Automator to change System Preference when opening an app

    Hello everyone,
    I have been using a Mac for a good 8 years now and I'm a happy user. I recently found out about Automator ('hey what is this little robot for?') and what it can do, yet I lack the knowledge of finding out what I must do to make a script to perform the following thing:
    When I launch an app (FL Studio), I want the box checked next to 'Use F1 and F2 as standard function keys' in the Keyboard preferences pane in the System Preferences app.
    When I close the same app (FL Studio), I want the box unchecked next to 'Use F1 and F2 as standard function keys' in the Keyboard preference pane in the System Preferences app.
    I have found several other topics about this subject, however, those were about scripts when logging in to your computer, and not upon opening/closing an app. Please note that I am seeking for the setting to be changed when the app is opened and closed.
    I hope you can help,
    Sander

    This kind of question comes up a lot - how to run a script when an application launches/quits.
    The short answer is that it's not easy to do directly, unless the application itself supports launching scripts on startup/quit (hint: few do).
    Fortunately, a little difference in thinking can give you the same effect.
    Rather than trying to have your script trigger AFTER the app launches, rethink your process to a script that FIRST changes the preference, THEN launches the app. You get the same result but about 14 billion times easier to implement.
    In this case, write a script to set the function key preference, then launch FL Studio. The script can then hang around to wait for the app to quit and reset the pref.
    Furthermore, don't try to do this the human way (open System preferences, select Keyboard, check the box). You can set the preference directly via the defaults command line utility:
    on run
      do shell script "defaults write .GlobalPreferences com.apple.keyboard.fnState 1"
      tell application "FL Studio" to activate
    end run
    Resetting the preference is a little trickier since you need to detect when FL Studio has quit. You can do this with an idle() handler in your script that hangs around, periodically checking if the app is still running and then taking action:
    on idle
      tell application "System Events"
      if (name of every application process) contains "FL Studio" then
      -- app is still running, so come back and check later:
      return 10
      else
      do shell script "defaults write .GlobalPreferences com.apple.keyboard.fnState 0"
      tell me to quit
      end if
      end tell
    end idle
    Putting these together in a Stay Open script should do much of what you want.

  • Changing System Preference value

    Hi
    Have been trying to change a keyboard shortcut in the "Expose and Spaces" pane. By default the dashboard shortcut is set to "F12" and I would like to set it to "F8". This would become an option for a user when they have logged in. They could run the script to free up the "F12" shortcut that's in use by another programme. Thought the following code would have worked:
    tell application "System Events"
    tell process "System Preferences"
    set value of pop up button 4 of group 2 of tab group 1 of window "Exposé & Spaces" to "F8"
    end tell
    end tell
    If anyone out there has any clues to get this working I would be grateful. Ideally a "defaults write" shell command would be the preferred route. I'm open to all suggestions.
    Thanks

    Hi,
    These preferences are scriptable under Leopard via System Events, and although you don't say specifically, I'm assuming that you're running Leopard because you're using Spaces.
    The problem is that the default shortcut for Spaces is already set to F8, and if you don't change it to something else first then you can't set the Dashboard shortcut to F8.
    This works for me:
    tell application "System Events"
    tell expose preferences
    set properties of show spaces shortcut to {function key:F7}
    set properties of dashboard shortcut to {function key:F8}
    end tell
    end tell
    When the script is compiled or run the third line changes to:
    set properties of application bindings to {function key:F7}
    But F7 continues to work as the shortcut for showing Spaces. A bug, I reckon.
    Hope this helps.
    H

  • Use Automator to Change System Preferences?

    Hi. I want to create a workflow or applescript that will open my system's sound preferences and change the output source. The Applescript editor doesn't record any of my actions.

    Modify the setting from System Preferences, and then look for plist files in ~/Library/Preferences/ and /Library/Preferences/ modified around that time. When you've located a possible plist, open the Terminal application in the /Applications/Utilities/ folder and enter 'defaults read ' without the quote marks. Drag the plist into the Terminal and press Enter; you will then see a list of keys. If a key looks like it contains what you're looking for, remember its value, change the setting again from System Preferences, and check the key again. Once you've found the key, you can use a 'defaults write' action in Automator's shell script option to change the value. If you can't write the key successfully, post back here with the name of the key and where you found it for further assistance.
    (12421)

  • Update mac os x 10.7 change system preference?

    Hello,
    I am a new Mac user. My Mac is os x lion 10.7. I was recently afraid of being infected with trojan and thus, I erased all the hard drive (7 passes) and then re-installed Mac os x. I set administrative password to access items with lock icon in system preference (like sharing, etc). However, after I installed the updates for Mac os x (update directly when clicking software update), I turned on my Mac and see that my setting for system preferences changed and the box "require an administrative password for item with lock icon" was unchecked (I was sure that I checked this box before).
    I do not know whether the update for Mac Os x did that change or the spyware/trojan is still in my Mac and made the change to make my Mac vulnerable?
    In addition, I set require administrative password to install any software or applications. However, when I clicked on "software update" from the apple icon to get updates, the updates installed without asking me for password. Is this strange and what should I do to set password for anything that need to install in my Mac.
    I really appreciate your help. Thanks a lot.

    There are no known viruses for Mac OS X. The system has built-in anti trojan/spyware. In short, you need to ignore a lot of warnings and just about invite it in.
    i'd re-install Lion again and leave System Preferences alone. You can do an install "in place". It shouldn't effect any of your data. That said, you should always have a good backup.

  • The "Play feedback when volume is changed" system preference is broken

    I don't want to hear the feedback sound when I change the volume, but my Mac stubbornly insists that I should!
    If I uncheck the "Play feedback when volume is changed" option in the Sound System Preferences pane, it works for a while. Some time later, when I change the volume using the keyboard keys, it ticks again. I have to check and uncheck the preference to get it to shut up... for a while.
    Also, I noticed it always ticks when I change the volume while Quicktime is opening a movie. If I wait until it has opened it, it doesn't tick anymore.
    This annoying problem started, as far as I can remember, from day zero.
    I fixed the also annoying balance drifting problem with http://www.whamb.com/balanced. Is there anything like that that will kill the volume change feedback sound and make sure it stays dead permanently?
    Thanks!

    This is happening to me too. The volume makes the noise, and when I open system preferences, "play feedback when..." is UNCHECKED which means it should not be making the noise. But I too have to check it and uncheck it in order for the sound to stop playing.
    Why isn't it saving my setting?

  • Can't change system preferences

    System preferences are locked. I click on the lock and the adminstrator's name and password box opens. I put in my info and it doesn't recongnize me. I'm too tired to spend the 2-3 hours searching trying to find the answer...
    Wish I never upgraded to 10.5, it's been one problem after another... Shame on Apple. They are usually better then this..

    BUICKWILSON,
    Investigate: Learn how to resolve Mac OS X 10.5 Leopard installation, startup, or login issues.
    ;~)

  • 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.

  • Using automator to change system preferences

    can i use automator to change my network settings. my stupid wireless at home does not automatically connect so everytime i get home i have to open up sys preferences and change the airport settings to manual and enter in the ip address of the router manually. can i create an automator script to do this in one step?
    any help appreciated. thanks.

    I have a similar problem with the ultra sensitive trackpad with the "Clicking, Dragging, Drag lock" checked in Preferences/Keyboard & Mouse. I'm always turning them on and off depending on which application I am using.
    My problem is that when I record a series of actions in Automator, the resulting action list has no text behind the action for the mouse click for the Clicking checkbox. Its as though it doesn't even know that its there. All of the other actions show up.
    Got any ideas on how to fill that void or another workflow that would do the same thing ? I think that running the workflow again would turn it back on as the actions are identical.

  • Safari will no longer open.  I was using firefox until I could find a fix for safari.  I made the mistake of changing my default search to firebox later for convenience and now I can't open my system preference or many safari or apple linked files.

    Safari will no longer open. It just goes back to my desktop.  When I right click on the safari icon in my dashboard it says it is open.  I was using firefox until I could find a fix for safari.  I made the mistake of changing my default search to firebox later for convenience and now I can't open my system preference or many safari or apple linked files. Some of my emails from trusted sites won't open and does the same thing. 
    I upgraded my original system from 10.4.11 to I believe 10.6. something about a year or so ago.  I thought about re installing my safari app but when I go to open anything connected to safari my screen goes back to the desktop.  I cant open any files that I have on my desktop that I set up through safari, like my banking program. Prior to changing system preference to safari default I was able to open those files and now I can't get into change it back.  Can you guide me through this?
    Thanks,
    Betty

    Try running the 10.6.8 combo update.
    10.6.8 Combo Updater
    System Preferences or Safari Preferences?
    Do a backup.
    Quit the application.
    Go to Finder and select your user/home folder. Select Library. Then go to Preferences/com.apple.Safari.plist. Move the .plist to your desktop.
    Restart the computer, open the application and test. If it works okay, delete the plist from the desktop.
    If the application is the same, return the .plist to where you got it from, overwriting the newer one.

  • Finder wants to make changes to system.preferences

    Every time we login to our iMac, a window comes up with "Finder wants to make changes" and asks for my password. The details indicate the change is to the system.preferences file, but I can't recall trying to make any changes.
    How do I make sure that someone (e.g., one of our kids) didn't change system.preferences? And how do I keep the message from coming up?
    (Note that up to now, I've been clickin on "Cancel".)

    DrNuke98 wrote:
    details indicate the change is to the system.preferences file
    Are you sure this is the correct message? There shouldn't be any file with the name "system.preferences". Post the exact message.

  • How can I reset new password in .mac system preferences?

    ...so that I can upgrade to MobileMe. When I type in my new password and hit Enter, or click over to Sync, it insists on remembering the old password, and then I can't sync. The odd thing is, when I enter the new password into .Mac preferences I get "thanks for being a member" and the days remaining on my account. The new password also works to log me in online, but I can't change system preferences to perform the upgrade to MobileMe. The old .Mac link to iCal works--the info is up to date--but the MobileMe calendar, contacts, bookmarks, etc have no data.. Any ideas?
    (I'm an only user using the admin. account (have one other account with unchanged original settings).

    OS X 10.7 Lion, 10.8 MountainLion & 10.9 Mavericks
    Reset Password starting from Recovery HD
    Start the computer,then press and hold down command and R keys to start into recovery partition.
    When you see the Apple logo, release the keys.
    Wait until  OS X Utilities window shows up.
    Move the mouse to the menubar at the top and click "Utilities", then select "Terminal"
    from the drop down.
    Terminal window will appear.
    Type in   resetpassword   and press enter on the keyboard.
    Leave the Terminal window open.
    Reset Password Utility window will open with Macintosh HD selected.
    Select the user account from the popup menu box.
    Enter a new password.
    Reenter the new password for the user.
    Enter a hint.
    Click the "Save" button.
    Click  in the menubar and select Restart.
    Log in.
    If Keychain dialog box appears, select “Create New Keychain”.

  • Error msg:  System Preferences not available on this Mac?

    I want to change my screensaver -- I last did it in the Fall of 2010.  Now I get this error message?  When I use Finder to search for System Preferences, the icon is faint with a strike through it.  How can I CHANGE system preferences?  Did this happen with last update of the OS?  Or when I set up iCloud to use with my iPad2?  Just had my iMac in the Apple Store and Genius Bar kept it overnight after checking out fail messages regarding the Drive and directories after running Tech Tool Deluxe.  They ran other checks and said it was all clean and the Drive is fine.  But what's this new issue? 

    It sounds like the System Prefs app is damaged. 
    What version of OSX are you running?  Assuming it's not Lion, you should be able to use the Pacifist app to extract it from the Install disc.
    Or, reinstall OSX.  See  Installing the ''combo'' update and/or Reinstalling OSX.

Maybe you are looking for

  • Not able to get the maintainance cost

    Hi all, I m stuck with a critical issue. I m not able to get the cost of maintainance. while creating maintainaince order I m getting ERROR - MISSING FORMULA IN WORK CENTER and a warning message NO PRICE COULD BE DETERMINED FOR INTERNAL ACTIVITY . I

  • Zen Vision, MediaSource and the Mac

    I am considering recommending that my girlfriend?purchase of?a 30 or 60Gb Zen Vision M as a basis for digitising her music collection. This recommnedation is based on my happy experiences with the excellent MediaSoure product on my ageing JukeBox III

  • Excel to numbers problem,,, please help!!!

    Hello I am new to numbers (and excel) but someone made me a xls file, it works great on excel but I want to use it on my iPad with numbers, it calcs my breaks.. So I only have to put in the time I start and stop working. The breaks are at 10:00-10:15

  • Method Binding to JSF 1.0 validate-Method error

    Hi there, Iam impressed, changing from Beta to 1.0 wasn't that much work at all, I just got one problem left: <h:inputText value="#{methodsBean.orderNumber}" validator="#{methodsBean.checkOrderNumber}"/> This is my method:      public void checkOrder

  • How to call BOMUIPrimaryPage using configurator extension

    Hi I am new to the configurator. I am working on the following requirement. From the Standard guided sales ui ( OA.jsp?page=/oracle/apps/cz/runtime/oa/webui/pages/CZMainPage) we have to call the (OA.jsp?page=/oracle/apps/cz/runtime/oa/webui/pages/BOM