Scripting system prefs

I have this script that turns the Fn button on and off so normally I just hit F12 and my audio goes up and down. But I do 3D animation in Lightwave and I need the F9, F10, F11 button to NOT control volume and such but do Lightwave commands like render and bring up windows. This script works and does its thing in 2 seconds, but sometimes I forget what mode I am in. Is it possible to get the state of the Fn button so I can display a dialog box that reminds me if I turned it off or on with this script. Thanks.
tell application "System Events"
tell application "System Preferences"
reveal anchor "keyboardTab" of pane "com.apple.preference.keyboard"
end tell
click checkbox "Use all F1, F2, etc. keys as standard function keys" of tab group 1 of window "Keyboard & Mouse" of application process "System Preferences"
tell application "System Preferences" to quit
end tell

Insert this in your script
<pre style="
font-family: Monaco, 'Courier New', Courier, monospace;
font-size: 10px;
margin: 0px;
padding: 5px;
border: 1px solid #000000;
width: 720px;
color: #000000;
background-color: #ADD8E6;
overflow: auto;"
title="this text can be pasted into the Script Editor">
set x to do shell script "defaults read -g com.apple.keyboard.fnState"</pre>
as i said, the answer will be either 0 or 1 depending on whether the checkbox is checked or not.

Similar Messages

  • Scripting system prefs: desktop assignments & syntax changes

    The problem I have is that I use multiple external monitors, but frequently use my 2014 15" rMBP disconnected. My workday involves two externals being connected, with multiple apps being used on those monitors. Most apps play nicely with the respective desktop assignments. However, Microsoft Excel does not. When the externals are disconnected, Excel defaults to displaying on the laptop. When the externals are reconnected, Excel does not automatically re-assign itself to Desktop on Display 2 (even though this setting is selected via the dock). It is, frankly, a function of Excel not playing well with Mac. No biggie - but I have to close, reassign to all desktops, then reassign back to Desktop on Display 2, every day.
    There should be an easy solution - a hot key linked to a command line code or AppleScript to solve this problem. In fact, I've located some options, but due to the changes in the way Mavericks' syntax is apparently structured, the options don't seem to work.
    For example, a post relative to OS X 10.5 suggests:
    tell application "System Events"
    tell expose preferences
    tell spaces preferences
    However, when compiling this bit of script, I get an error that "Expected end of line but found application constant or consideration", relative to "expose preferences" and "space preferences".
    If that problem did not occur, I imagine the full code might look like this:
    tell application "System Events"
      tell expose preferences
      tell spaces preferences
        set x to application bindings
      set x to {|com.microsoft.Excel|:4} & x -- Have Excel appear in space 4
      end tell
      end tell
    end tell
    I hope someone out there can comprehend what I'm trying to accomplish and help me solve this …
    Many thanks

    Nevermind - after rebooting it is working ok now.

  • Non admin user - changes not saved (Safari settings, system prefs, etc.)

    iMac, 2 users, one is administrator and other is standard user. Recently, in the non-admin user account, it has become impossible to make any changes. For example, adding an application to the the Dock, after logging out and back in next time, the application is not in the Dock any more. Also, making changes to the prefs in Safari, changes are not saved.
    I noticed this after installing FireFox v4. I installed it as admin whilst in the non-admin users account. However, I don't believe that the installation of FF has anything to do with the problem, it just highlighted it. I've checked the permissions for the various directories that hold prefs info such as user/libraries/application prefs/etc. etc. and also Safari prefs. Nothing I can see that has changed in system prefs.
    Any ideas on what has caused the problem (kids are known to fiddle from within the non-admin account) and any ideas on how to fix it?
    Thanks

    Hi PPRuNe,
    You could try making the standard user an Admin too. To do this, make sure you are logged in to the standard user, go to System Preferences > Accounts > Standard user (you may have to unlock the padlock) > Allow user to administer this computer
    This will allow changes to be made without being prompted for a password all the time.
    However, if you had Parental Controls on, they probably won't work on an admin account because as an admin you have complete control over a computer, so the computer thinks there is no point in having the controls turned on. And if the kids are known to "fiddle," just think carefully!
    Hope this helps you.
    Chris.

  • HT1338 i lost my iphone and my macbook pro does not show the icloud in system pref. What do i do? how do i download icloud?

    I lost my iphone and my macbook pro does not show the icloud in system pref. how do i get icloud on my mac?

    iCloud is only available in Lion, 10.7. You will have to upgrade to Lion in order to get into iCloud. If you transfered a .mac or .me address to iCloud through mobile me, or you have another device iCloud enabled, then you can log into the iCloud.com website.

  • How can i use my smart TV as a second monitor for my Power mac (2010) via HDMI cable? i've made the connection but no options show in system prefs display.

    How can i use my smart TV as a second monitor for my Power mac (2010) via HDMI cable? i've made the connection but no options show in system prefs display.
    the computer:Mac Pro, Mac OS X (10.9.5), 2 x 2.66 Ghz 6-Core intel Xeon
    the TV: LG Smart tv

    The Mac uses a highly-parameterized universal Driver for every display. The parameters are set at certain times when a query is sent to your display. The display MUST answer with its name and capabilities, or the screen stays dark. A TV set that is off or "not paying attention" because it is set to a different port when the query occurs will rarely answer, and so will often remain dark.
    You can use tools in the System Report to see whether your display has been detected at all. If it has, the report will look something like this, but its name will appear:
    The times when the query is sent are:
    • at Startup
    • at wake from sleep
    • when the Mac-end of the cable is inserted
    • when using the Option ( Detect Displays ) button in displays preferences

  • I have a photo cd from photographer that was burned on a mac but it will not open on my mac.  It goes in, makes some noise, then ejects.  My system pref. is set to open iPhoto when a photo cd is inserted.  She has sent me 2 disc and both do the same thing

    I have a photo cd from photographer that was burned on a mac but it will not open on my mac.  It goes in, makes some noise, then ejects.  My system pref. is set to open iPhoto when a photo cd is inserted.  She has sent me 2 disc and both do the same thing.  Any ideas?

    NOt an iPhoto issue - either a bad CD or a bad Superdrive on your computer - no way for us to tell  try the CD in a different computer
    LN

  • I have not been able to sync my mail with iCloud on my MacBookPro (Lion OS).  Everything else has been syncing fine for the past two months, but when I go to System Pref/iCloud/and try to check Mail, it asks me to choose an iCloud email address. When I

    I have not been able to sync my mail with iCloud on my MacBookPro (Lion OS).  Everything else has been syncing fine for the past two months, but when I go to System Pref/iCloud/and try to check Mail, it asks me to choose an iCloud email address. When I put in my regular @me.com email, it says that address already exists (of course it does - it's mine!) and wants me to choose another one.  But I want it to sync with my stuff.  What can I do?  I haven't been able to find help anywhere online...  Thanks!

    You should have signed in with that address in the first place, but there is a workaround: go to System preferences>Mail, Contacts@ Calendars and add your @me.com address as an account there.

  • TS4006 How do I add iphone4s to iCloud's "find my phone"? I turned on macbook pros system prefs to "find my phone", turned on iphone4s's "location services" and set up iCloud, etc. iPhone4s still won't show-but macbook does show. It receives gmail, weathe

    How do I add my new iPhone4s to iCloud's "Find my iPhone"? I followed the iCloud instructions and turned on Macbook Pros' system prefs to "find my mac", turned on iPhone4s's "location services" and set up iCloud, etc. In the "Find my iphone" tab of my new iCloud account (on my Macbook Pro) my iPhone4s still won't show—but my macbook does show. I had my iPhone4s set up at the phone store (2 days ago) and It receives gmail, my contacts and calender entries, the weather, etc. I installed the "Find iPhone" app from iTunes on the iPhone4s, synched to iTunes, even reset the phone, but the only device that gets located is my Macbook Pro. I can send a "sound" message to my Mac (and the Mac recieves it) but unable to see the iPhone4s from my Mac, let alone send any message. Any suggestions to get the iPhone4s device to appear in iCloud?
    Thank you in advance for your help.

    OK, I figured it out...I deleted the iCloud account off my iPhone (Settings, iCloud, Delete Account), and then added iCloud back in (Settings, iCloud, SignIn)....and then my email (iCloud) and "Find my phone" features worked! Nice!!!!

  • How can I get back to default in System pref/ displays/ color. iMac 10.9.5

    How can I get back to default in System pref/ displays/ color?  iMac 10.9.5

    Select the iMac option.
    27" i7 iMac (Mid 2011) refurb, OS X Yo (10.10), Mavs, ML & SL, G4 450 MP w/10.5 & 9.2.2

  • How can i remove the spell check from my iMac, i tried system pref but it still autocorrects

    how can i remove the spell check from my iMac, i tried system pref but it still autocorrects

    Look at the Spelling settings in the Edit menu of the app that is doing the correcting.

  • Built-In Audio Panning L&R malfunctions, system prefs.

    I have noticed on my own Mac, as well as my peers' computers which include iBooks, PowerMacs, iMacs, and even a new MacBook pro, that the audio coming from the Built-in audio card will randomly be panned completely to the right, or the left.
    A quick troubleshoot will lead you to find that in the system preferences the panning slider is set to the right or left, an undesirable setting.
    All of the computers I mentioned are running the latest updated versions of Tiger, 10.4.6, and with the exception of my self running Pro Tools, none of the other computers mentioned are running any third party audio interfaces/cards or software that uses audio other than the applications included with Tiger: iTunes, iChat, Quicktime, Safari, etc.
    Unfortunately there is no Lock in the audio system preferences, which could potentially be a quick fix to the problem because if an application like iChat had a bug which caused audio panning, the lock in system prefs. would prevent that..
    I am quite boggled.
    question:
    What might be causing this, and is there a solution?

    Thanks for the response guys. It seems we're in the same boat.
    The problem is intermittent on my machine . It has occurred three times since I bought it. The fist time it lasted for a day and a half. I rang Apple support and went through a number of steps until the P-RAM suggestion which seemed to fix it. A few days later it disappeared again and resetting the P-RAM had no effect. My wife continued to use the computer (without sound) and some hours later it came back after a restart (she only restarted it because she is in the habit of shutting down instead of using sleep). The problem occurred again. That time I restarted the machine a number of times, with and without the external speakers plugged in, with them turned on and off etc. This had no effect. I gave up. Some time later my wife went to use the computer and it came back. I now believe that the P-RAM solution that seemed to fix the problem the first time was just a coincidence.
    I rang Apple support again and they gave me the following steps (A,B & C of which I went through the first time the problem occurred):
    A: Log in through another account and see if it had the same problem.
    - The built-in audio was still missing.
    B: Run the disk utility on the hard drive (after booting from installation DVD).
    - There were nil problems on the HD, but it did not fix the problem.
    C: Reset the P-RAM.
    - This worked the first time though it has not worked on subsequent re-occurrences of the problem.
    D: Do an Archive Reinstall.
    - I did this today; though the built-in audio was working, I just wanted to complete the suggestions the Apple support person gave me. The problem has not reoccurred yet, but it has only been a few hours. I will be using the computer as much as possible tonight to see if the problem reoccurs.
    If the problem reoccurs I'll be taking the machine in for warranty repairs, or better still replacement.

  • Security tab no longer showing in System Prefs.

    Hi
    I have a white Macbook aprox 18 months old. Yesterday I opened system prefs and there was no longer a Security button. I just changed ISP and went in to the firewall the other day, but now it isn't there. Any help would be much appreciated.
    Thanks
    K

    Hi LilacRose;
    In your profile it says your are running Tiger. If that is correct, you should post over in the Tiger forum instead of the Leopard forum.
    Allan

  • Scanning in Mavericks? I can no longer use the scanning function in my HP Officejet 4500. HP says to go through Preview, Image Capture, or Print/Scan in System Prefs. Still doesn't work. Any ideas/similar experiences?

    Scanning in Mavericks? I can no longer use the scanning function in my HP Officejet 4500.
    HP says to go through Preview, Image Capture, or Print/Scan in System Prefs.
    Still doesn't work. Any ideas/similar experiences?

    Sure it is, yet it's called HP LaserJet Professional M1210nf MFP Series *
    Today, I followed your other advice, and deleted the printer, deleted the /Library/Printer/hp folder, downloaded the entire set of driver, re-installed the printer twice, once with the driver, once with Bonjour.
    The Bonjour Printer has the scan option active, but it is doesn't work (refer to above.), it is called M1217nfw
    The Apple Driver Printer doesn't show the scan option at all, it is called M1217nf (as on the http://support.apple.com/kb/HT3669#HP list.) This model number doesn't exist, as far as I can tell. 
    Still, everything works perfectly in Snow Leopard, for a MF printer that has been manufactured years after Snow Leopard was released.
    Why going up in software version means going backwards in compatiblity for brand new product is really the question that puzzles me here.

  • Access to non-apple system prefs

    We are in a corporate environment. When setting up new Macs we turn off access to the System Preferences using the Accounts Control Panel. We want to prevent users from changing Network settings, Sharing options, etc. that we setup up for our company.
    The problem with this is when we install software for third-party products such as mice or graphics tablets. Many of these items install Control Panels that are accessed only through the System Preferences, but a non-admin user cannot go in and change the individual settings for these devices without having full admin rights to the System Preferences.
    Are there any workarounds for being able to control which Control Panels users have access to when using System Preferences?
    Thanks for any help!

    If your users are non-admins, they shouldn't be able
    to change the Sharing or Network prefs unless they
    enter an admin password. When setting up the new
    accounts, go into those prefs and ensure the little
    padlock icon is locked.
    Apparently this has improved over earlier versions of OS X when I wasn't looking. When we intially loaded OS X I remember turning on the access to System Prefs and locking the various control panels for the non-admin users, but I recall that some of them didn't stay locked. That's why we started turning off access to them completly. After that initial install of our desktop Macs I never tried this again. We've updated the OS a couple times, but never went in and tried this again because everything was working fine. But when I went to setup some new laptops with wireless mice that had their own control panels this became an issue and that's why I was looking for the workaround. It would be nice if Apple gave you a way in System Preferences to turn on/off access to the individual CPs without having to muck with system like this. But this will work for now.

  • System Prefs - options greyed out or non-functional

    I have been having a bad time lately with my System Prefs. I first noticed it when settings to Mouse and Sound would not retain after a restart.
    Now the problems are much worse...
    I cannot open the Date & Time pane at all (ignores clicking), all options in Sharing are grayed out and cannot be changed (even though account is admin and the lock is unlocked), I am unable to create a new user, and changes to Energy Saver result in spinning color wheel.
    I have deleted every preference and cache I could find in the user and rebuilt permissions but no luck. I am considering enabling root and seeing if that can go in and make changes since I cannot create a new admin user otherwise.
    Short of a painful OS reinstall anybody have suggestions?
    I also might consider riding it out and waiting for 10.5.

    Ralph Johns (UK) (to Emily Vu) 19 minutes ago
    Hi,
    Check the Font AppleGothic.ttf is active and validates using the Font Book app.
    if you have to change anything restart the Mac.
    If this is not the issue go to ~/Library/Preferences and find com.apple.ichat.plist and Drag it to the Trash and then restart Messages.
    The above reply in another thread solved my issue! Namely that my apple gothic font was disabled, breaking the entire Messages app.

Maybe you are looking for

  • Authorisierung des Digital Editions auf einem zweiten Computer!!

    Hallo, ich möchte das Digital Editions auf meinem neuen Rechner authorisieren, da ich keinen zugriff mehr auf meinem alten Computer haben. Das System sagt immer, dass das nicht geht, da diese Authorisierung bereits auf einem anderen Gerät vorhanden i

  • How to add space between two tabs in accodion widget?

    Hi! I am using the accordion widgets and trying to add space between each of the tabs, would someone help me on this. Thanks

  • And so it begins...

    ATT goes to tiered data I thought it would take a little bit longer, but stage two of the data scheme has been launched by ATT. No more $30 unlimited data plans, now it's $15 for 200mb or $25 for 2GB, with overage rates for each plan. I really like h

  • Asset Class under Sub Group of assets

    Dear All,   In my Client place they are have list of assets.  I clasify in Asset classes like Plant & machinery, Buildings, Land -Asset Classes In Buildings  they have Differenct Factory Building and Office Building which is situated in Factory itsel

  • Sign in required box keeps popping up

    Even though I've now reset the password again, I keep getting the "Sign in Required" box.  This is when I'm trying to install an app.