Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Your error code has nothing to do directly with your AppleScript. Error –10810 is a Launch Services error code signaling a generic, i.e. unknown error. It seems to get thrown quite often when OS X’ process table runs over. There is a quite thorough <a href="http://www.thexlab.com/faqs/error-10810.html" rel="nofollow">background post on the issue at the X Labs</a>, complete with step by step instructions to diagnose (and possibly remedy) the issue.</p> <p>On an OT note, I notice you use GUI scripting to toggle Hot Corners on or off. This is unnecessary: Lion’s <em>System Events</em> can script these settings via its <em>Expose Preferences Suite</em>, i.e.</p> <pre><code>property hotCornerSettings : {} to disableHotCorners() set hotCorners to {} tell application "System Events" tell expose preferences set end of hotCorners to a reference to bottom left screen corner set end of hotCorners to a reference to top left screen corner set end of hotCorners to a reference to top right screen corner set end of hotCorners to a reference to bottom right screen corner repeat with hotCorner in hotCorners set hotCornerProps to properties of hotCorner set end of hotCornerSettings to {hotCorner, {activity:activity of hotCornerProps, modifiers:modifiers of hotCornerProps}} set properties of hotCorner to {activity:none, modifiers:{}} end repeat end tell end tell end disableHotCorners to restoreHotCorners() tell application "System Events" tell expose preferences repeat with settings in hotCornerSettings set properties of item 1 of settings to item 2 of settings end repeat end tell end tell end restoreHotCorners </code></pre> <p>… which spares you the can of worms that is GUI scripting.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. COThanks for the response and the info on the expose in Lion. I'm a bit confused with the code though because it doesn't appear that any of the settings are being stored anywhere. How does it know whether or not it is restoring the correct settings? Again, sorry for my ignorance with Applescript :/
      singulars
    2. CO@Floofer: it’s storing the settings in an AppleScript property in the first line. Properties keep their value after a script is run (they are only re-initialized when the script is re-compiled). The [Apple Script Language Guide](https://developer.apple.com/library/mac/#documentation/AppleScript/Conceptual/AppleScriptLangGuide/conceptual/ASLR_variables.html#//apple_ref/doc/uid/TP40000983-CH223-SW10) has all the gory details on properties and their scope.
      singulars
    3. CO@Floofer: ah … just got what your issue is (and sorry for adding another comment, my 5 minute editing window has passed): the script stores your current settings in the above mentioned property – i.e. your hot corner settings when not disabled. This means you don’t have to hard code these into your script, and that the script will always restore to the state it found. Note I only provided handlers. You will have to add the `do shell script` line, calls to the two handlers provided and the quit commands (which, incidentally, can be written as one-liners, i.e. `tell application "X11" to quit`).
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload