Accessing System Preference pane elements by Applescript

I'm new to Applescript, and I'm trying to figure out how to set a hot corner in the Expose pane of System Preferences. I've been searching for Apple documentation, but I can't seem to find a good reference page.
Does anyone know what I'm doing wrong here?
<code>
tell application "System Events"
  tell process "System Preferences"
   tell menu bar 1
    tell menu "View"
     click menu item "Exposé & Spaces"
     delay 1
     tell tab group 1
      click radio button "Exposé"
      tell popupbutton
       tell menu 1
        click menu item "Spaces"
       end tell
      end tell
     end tell
    end tell
   end tell
  end tell
 end tell
</code>

I'll answer just three of your questions:
1. Is there a reason why we need to "end tell" "menu bar 1" after "click menu item 'Exposé & Spaces"' is done? (lines 4-11)
The reason is that the menu item "Start Screen Saver" is not part or the same hierarchy than the menu item "Exposé & Spaces". The menu item "Start Screen Saver" belongs to a menu which belongs to a pop up button which belongs to the group "Active Screen Corners" which belongs to a tab group which belongs to window "Exposé & Spaces" which belongs to the application "System Preferences".
2. What is the "window" in '*tell window "Exposé & Spaces"*'?
The window "Exposé & Spaces" is the window that replaces the "System Preferences" window when you click the menu item "Exposé & Spaces" of the "View" menu.
4. How come we need to "tell pop up button 1" before a click, instead of "click pop up button 1"?
Because we tell pop up button 1 to click AND tell menu 1 to do something. We could also have written:
tell group "Active Screen Corners"
click pop up button 1 -- or 2 or 3 or 4
tell menu 1 of pop up button 1
click menu item "Start Screen Saver" -- or any other menu item
end tell
end tell
As for your other questions, here are some references:
For GUI Scripting, have a look at this Web page:
http://www.macosxautomation.com/applescript/uiscripting/index.html
You should also download and use "UIElementInspector 1.3":
http://developer.apple.com/samplecode/UIElementInspector/
But before all, to get a better understanding of AppleScript, you should look at these pages:
http://www.macosxautomation.com/applescript/learn.html
http://developer.apple.com/documentation/AppleScript/Conceptual/AppleScriptLangG uide/introduction/ASLR_intro.html
(From my own point of view, AppleScript is rather difficult to learn, and GUI Scripting still more.)

Similar Messages

  • Accessing System Preferences Pane from Apple Menu

    When I access the system preferences panel from the Apple Menu at the top left corner of my laptop computer, not all icons on the syetem preferences window will work correctly.  Some say they cannot find the application requested.  But when I create a shortcut for the system preferences folder from the applications folder on the bottom right hand corner of my screen, and open the system preferences folder from the shortcut I placed on my desktop, then all the icons on the system preferences folder appear to be working. 
    This indicates to me that there is some sort of an indexing problem when installing Mavericks on laptop computers, and that Mavericks Operating system is NOT QUITE READY FOR THE USER COMMUNITY.  I do hope this probelm is RESOLVED QUICKLY!

    You can access System Preferences from Apple menu
    When System Preferences is open you can fix its icon on the Dock as follows

  • Can no longer access Accounts preference pane !

    At home I work on an iMac. I’m the admin, each of my children have their own user account. While I was working in ‘System Preferences > Accounts’ to adjust some of the permissions on one of the accounts the power went down. Once the power was back on and I restarted the computer I found everything worked fine but the account I was working on has disappeared from the log in pane. When I log in under my admin account and try to access ‘System Preferences > Accounts’ by clicking “Accounts’, in stead of al list of all accounts I get a blank window. This means I can no longer manage any of the accounts, including my own.
    I checked the hard disc and the permissions by running Disk Utility: no problems.
    I guess the power outage must have damaged some file or other but I have no idea where to start.
    Anybody have any idea?
    iMac Intel 2 Core 2 Duo 2.33 Ghz 24" 500 GB   Mac OS X (10.4.8)  

    Hello Barry,
    Thanks for taking the trouble to answer me.
    We may have a language problem here (I’m working with a Dutch version of OSX).
    Before I posted my question I checked the disk using ‘Applications>Utilities>Disk Utility.app’. Could this be the same program you’re referring to as ‘repair disk’ on the Install CD because on the Install disk I can find no program called ‘repair disk’ but I can find ‘Disk Utlilty.app’?
    Disk Utlilty when I ran it couldn’t find anything wrong.
    Frank
    iMac Intel Core 2 Duo 24" 2.33 Ghz Mac OS X (10.4.8)

  • ICloud system preference pane

    MacBook OS 10.7.4. The iCloud system preference pane does not open to the settings options - it directs me to Find my iPhone. Settings appear as expected on my iPhone.  My iCloud account is available on iCloud.com. Any suggestions?

    I'm not really sure what it is that you are asking, but in case it is relevant, you cannot access iCloud.com from an iOS device. Any iCloud data you wish to access on an iOS device, should be accessed through the appropriate app, such as calendar, contacts etc.

  • System Preferences pane and ipfw rules conflict

    If i configure ipfw rules using this script (launced with sudo):
    #!/bin/bash
    ipfw add pipe 1 ip from any to any out
    ipfw pipe 1 config bw 200Kbit/s queue 50KBytes
    ipfw add pipe 2 ip from any to any in
    ipfw pipe 2 config bw 2Mbit/s queue 50KBytes
    or using WaterRoof (http://www.hanynet.com/waterroof/).
    When I try to access the Firewall configuration page of the System Preferences pane an alert window notice me that there is another software firewall already running and that I should disable it to be able to access rules configurations from the System Preferences pane.
    Is it gone crazy? What should I do to have access to firewall configuration from the System Preference pane and contemporary have access to commandline advanced rules, avoiding them to conflict?

    The "solved" post in this thread addresses how to regain control, albeit not while simultaneously allowing control from a command line ipfw or the WaterRoof GUI front-end.
    The first "helpful" post in that same thread talked about how if Sys Prefs Sharing saw an altered ipfw list, then Sharing assumed other firewall software was running, so you got the "other firewall" splash screen, or something like that.
    It appears that they don't like to coexist, and there's probably nothing that you can do about it.

  • System Preferences pane - security icon no longer works on all tabs

    System Preferences pane has several tabs where there there is a security option, i.e.: a padlock icon with 'click lock to prevent further changes".
    the icon is not working on all the tabs - it works on some tabs, but on others it just flashes and stays unlocked.

    so today it works... WT*!

  • How do I set up the magic trackpad when I can't access System Preferences

    Bought a new iMac and Magic Mouse.    After initial installation, decided to swap mouse for the Magic Trackpad.
       Trackpad is turned on but I am unable to access System Preferences since my iMac was paired with the Magic Mouse.  I don't have another USB mouse to complete the pairing.  Any suggestions?   Thank You.

    Nancy,
    If you have the bluetooth icon in the menubar, you can reach that and open bluetooth preferences by
    pressing FN CNTL F8.  This will move focus to the right side of the menubar, then arrow across and down to get to the options you need.  Press the spacebar for "enter".
    Regards,
    Captfred

  • System Preference Panes non-functional (some)

    I am "fixing" a friends MacBook Pro as a favour, and she's getting exactly what she paid for. It may be a few years old - not sure. It's running Snow Leopard, 10.6.8, but I'm putting it in this more general section because it may not be SL-specific.
    A few of the System Preferences panes don't work. A message comes up which simply says "non-functional" or something like that. Specifically, the ones whcih don't work are:
    Desktop and ScreenSaver
    Spotlight
    Energy Saver
    Background: she forgot her password, and this is on a computer which was formerly someone else's. I couldn't even get the thing to the login screen, so something else was wrong besides her password, but I had her gray Snow Leopard installation disks, so got through the re-install process, made a new User for myself, as Administrator, and was then delighted to find that all of her data was still intact. I had to add myself in to the permissions on her UserID. I made a new user for her as well, because we still didn't have her own original password, and I looked around but couldn't find it. I copied all of her data over to her new UserID.
    I also did all Updates, plus tried a 10.6.8. combo update.
    Then I made an error. The former owners UserID was also still there. We couldn't log on as her either, without her password, but I figured that we didn't need that anymore, checked with the current owner first, and deleted the original User (and renamed the computer). I cannot reconstruct in my mind whether the System Preferences panes malfunction occurred before or after deleting the original User.
    There is other minor wonkiness, but basically the machine is running and the data has been preserved (and now backed up). But one thing at a time: I've reinstalled the OS a couple of times, without improvement. I tried to upgrade to Mavericks, but after downloading, it told me that this computer could not be upgraded (without saying why not).
    I haven't found any plist files which look relevant. I did more 2 of them out of HD-Library-Preferences, without any effect, so put them back. I find the Preference Panes in System-Library-PreferencePanes, but didn't see anything to do about that. The offending panes look like they're at least present.
    Is there something simple I'm missing? Can I get those panes back?
    Thank you.
    Charles

    Macbook pros need to be at least 2009 for 13" and 2007 for 15" and 17" to run Mavericks.  see system requiements.
    At this point, the easiest solution will be to make your backups current, then wipe the drive and do a clean install of the system. That means more work reinstalling the backed-up data (you only want to restore data and third-party apps, not any of the system components), but it makes sure you get a clean, working copy of the system.

  • Some system preferences panes won't open

    I just installed Mountain Lionon my iMac. When I try to open the System Preferences panes for Notifications; Security & Privacy; iCloud; Mail, Contacts & Calendars; and Desktop & Screen Saver though, I get the message
    To use the “[Name of pane]” preferences pane, System Preferences must quit and reopen.
    Selecting OK causes the System Preferences to disappear and then come back, but that same error message is still there. How do I get rid of it so I can acess those panes? Thanks!

    Yep:
    Go to Applications folder
    Select System Preferences
    Enter Command I
    Under General, deslect Open in 32-bit mode
    Then try to acess what you were trying to earlier.
    Good luck!

  • System preferences panes won't open in M.L.

    I just installed Mountain Lion on two machines, apparently with success. With a MBP, and only in one account, I can't open selected panels in system preferences panes: notifications, desktop and screensaver, security and privacy, date and time, dictation and speech, time machine, and startup disk. This issue is specific to my account. I've another account on this same machine and the preferences panes open and work. I've already done the permissions repair, used Disk Utility in Recovery mode, repaired the hard drive disk, and reinstalled Mountain Lion, all to no effect. On my iMac, all works well. Does anyone have an idea of what to do next?

    Right click on the System Preferences app in your Applications Folder. Select "get info" and make sure the 32 bit check box is NOT checked.

  • Not able to access desktop preference pane after Yosemite upgrade

    I upgraded my early 2008 Mac Pro to Yosemite and now I can't change my desktop image or even access the preference pane for it. When I try to, I get a message that says "Preferences Error - Could not load Desktop and Screen Saver preference pane." It looks like my desktop.plist have disappeared. Does anyone know how to fix this?

    when I loginto EM, Application Policies > Create Application Grant
    here it is asking for grantee and permissions. if I click + to add grantee and search for weblogic....there I got it.
    if I try to add permission.........here I can see 1.permissions 2. resources
    I dont know what to select from above for presentation server admin role....there are so many options out there.
    another question is I want to remove Administrator user because there is no more Administrator here in 11g and BIAdministrator is a role can have multiple users ex: weblogic, obiadmin etc.
    so can I remove Administrator user in EM and create new user i.e 'obiadmin' and grant full admin access just for obiee and em. and weblogic user can only access admin console .....????
    appreciate for your help!
    Thanks
    Jay.

  • Security & Privacy System Preferences pane cannot open!

    my env:
    - Max OS X 10.7.3
    - 2.2 Ghz Intel Core i7
    this month , i can not enter Security & Privacy pane from System Preferences
    - when i click
    - pop alert windows, tell some error
    what can i do now?!

    that magic is:
    - my MacBookPro set up two user
    - in my user,  Security & Privacy System Preferences pane cannot open!
    - but switch another user ,
      open Security & Privacy System Preferences pane  is OK?!
    What make this happened?!

  • Epson scanner perfection 1670 is not detected on system preference pane

    It use to work but now it only produces blank grey scans.
    I have deinstalled and reinstalled new driver from Epson support site.
    I have also tried cleaning the USB connection with no results.
    I have noticed that when I tried connecting to the internet from the the scanner Help menu it tells me I am not connected (while I am) and I noticed also that the scanner is not detected on system preference pane.

    You can open System Profiler and under the Hardware heading you will see the USB entry. The printer should be listed under one of the USB busses. If you don't see it then the USB cable could be faulty or the printer itself could be cactus. So try another USB cable and in another port on the Mac. If the new cable and socket fails to make the printer appear in the USB view then the printer is the problem.
    If the printer is visible under one of the USB busses then this would indicate that the printer and the USB cable is okay. In this case the printer should be capable of being added in Print & Fax. But if you select to add the printer and it does not appear in the Default view of the Add Printer pane then try a reset of the printing system, as described next.
    1. Open System Preferences > Print & Fax
    2. Move your mouse over the Printers list
    3. Hold down the Control button and click the mouse
    4. Click the "Reset printing system ..." popup
    5. Restart your Mac

  • Launching Acrobat 9 from system preference pane

    How do you launch new Acrobat 9 from System Preference pane? Message comes up "FMCore stopped. Start from System Preference pane, then relaunch. Illustrator does the same thing.

    Update your Extensis Suitcase with the latest version. Check on their website. It's not an Acrobat or Illustrator problem.

  • Need to access system preferences on my iPad in order to open print que...do not have computer connected to air printer

    How do I access system preferences on my iPad in order to open print queue in order to delete/resume print jobs?

    OK. This is a new one on me. But if the printer has stopped, how do you access the print queue since the article states that you can only access the print center while the printer is printing?
    Viewing the Print Queue
    You can check the Print Queue by double-tapping the Home button to show the recently used apps. Then tap the Print Center.
    Note: The Print Center is only available while printing is in progress.
    If you can only view the print center while printing is in progress and Sharon needs to open the print queue - in order to start printing again ...... how does that work then?

Maybe you are looking for

  • How do I connect my Synology NAS to my AirPort Extreme base station?

    I'm considering replacing an Apple AirPort Extreme base station with my current 5 year old router.  I would appreciate if someone could tell me how the AirPort Extreme differs from any regular router.  I do not have any OS X devices, but I have a lot

  • Unable to convert aac (m4a) to another format

    I have hundreds of m4a files in iTunes, and I want to convert them mp3. however every time I try, I get an error message "Error occurred while converting the file "myFileName". The disk could not be read from or written to." now, I know you'd general

  • How to create new cost groups in inventory org using API or open interface?

    Hi, I would be very kind of you if you can provide me with a solution to my question below. I have a requirement of copying all the cost groups from one inventory org and creating the same cost groups in another inventory org using programmatically.

  • Table of Contents not working!

    Hi, I'm writing a paper for graduation and I have a big problem concerning the Table of Contents. I've paragraphed all my headers. In total I've used Header 1 till Header 4 and for the text I've used the body paragraph. So when I want to insert the t

  • Can't set flash player as default app to open SWF files on mac

    This is the weirdest thing. Somehow the default application to open SWF files on my mac has changed from the Flash Player to a random Mac Projector file (i.e. presentation.app) that I published from Flash for another project. So whenever I double cli