Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > macOS > (Temporarily) deactivating Expos�

(Temporarily) deactivating Expos�
Thread Tools
Taipan
Dedicated MacNNer
Join Date: Jul 2002
Location: Germany
Status: Offline
Reply With Quote
Feb 11, 2004, 04:43 PM
 
Hi!

I'm using the hot corners in Expos� and during normal use it's fine, but sometimes in games (e.g. Ghost Master) I have to take care to avoid moving the mouse towards the corners or Expos� kicks in and messes up the game. Is there a way to temporarily deactivate Expos� without opening system preferences and manually deactivating the active corners, maybe via AppleScript? Thanks!
     
Moonray
Mac Elite
Join Date: May 2001
Status: Offline
Reply With Quote
Feb 11, 2004, 10:21 PM
 
Yes you can with Applescript.
Make two scripts like this one:
Code:
tell application "System Preferences" activate set current pane to pane "com.apple.preference.expose" end tell tell application "System Events" tell process "System Preferences" tell window "Expos�" tell group 1 click pop up button 1 -- top left corner click menu item "All Windows" of menu "OtherViews" of pop up button 1 delay 1 click pop up button 2 -- bottom left corner click menu item "Application Windows" of menu "OtherViews" of pop up button 2 delay 1 click pop up button 3 -- top right corner click menu item "Desktop" of menu "OtherViews" of pop up button 3 delay 1 click pop up button 4 -- bottom right corner click menu item "-" of menu "OtherViews" of pop up button 4 end tell end tell end tell end tell tell application "System Preferences" to quit
Just replace the words in green with the actions of your personal preferences (you'll need to use the German words you see in the pop-ups if you run OS X in German) in the first script (to activate the hot corners) and with a hyphen in the second (to deactivate).

-
     
Taipan  (op)
Dedicated MacNNer
Join Date: Jul 2002
Location: Germany
Status: Offline
Reply With Quote
Feb 12, 2004, 03:49 AM
 
Thank you very much, I think this almost works. I have never dealt with AppleScript and don't really know how to use it, so here's what I did:
I copied the code you wrote and pasted it into the ScriptEditor, replaced the green phrases with the German translations, clicked the execute button, and after system preferences have been launched and switched to the Expos� pane I got this error message:

�System Events� has received an error: NSReceiverEvaluationScriptError: 4


As I said, I don't know anything about AppleScript, but the only thing in the code that doesn't seem self explanatory to me is the "Other views" thing. Maybe this has to be translated, too (I would have tried, but since I don't know what it means, I couldn't figure out what the translation would have been)?
     
Moonray
Mac Elite
Join Date: May 2001
Status: Offline
Reply With Quote
Feb 12, 2004, 05:05 AM
 
Getting this error 4 means it does not find that "word" you use. If you run it from the script editor it should highlight the line in question (it is "OtherViews" in one word btw). For more debugging you can write
Code:
click menu item "All Windows" of menu "OtherViews" of pop up button 1
as
Code:
tell pop up button 1 tell menu "OtherViews" click menu item "All Windows" end tell end tell
If that does not help, you can download Apple's UIElementInspector (unpack the .sit, find the Application and move everything else to the trash), it will show you some names but doesn't work well with pop-up menus (and can be confusing).

But then when I just try,
Code:
click menu item "Schreibtisch" of menu "OtherViews" of pop up button 1
seems to work fine.

-
     
Taipan  (op)
Dedicated MacNNer
Join Date: Jul 2002
Location: Germany
Status: Offline
Reply With Quote
Feb 12, 2004, 04:08 PM
 
Here a short rundown of a funny evening:
Together with a friend who has some experience in programming I played around for a few hours, and finally we got it running by using keystroke commands and key codes instead of the click commands. Failing to find out how to get a script that can be started by simply double clicking the icon without having to answer the dialog (run or quit), I looked through the AppleScript folder and found a few script examples, which we started to examine. At the end of every single single script we came across these lines:

set current pane to pane "com.apple.preference.universalaccess"
display dialog "UI element scripting is not enabled. Check \"Enable access for assistive devices\""



So, finally the problem is solved, except for the fact that disabling a specific corner's function by using the hyphen in the code doesn't seem to work (at least if the system language is set to german). We got around this using an 8 as an argument instead of the "-".
So one last question remains: What's the easiest way to start the script? Do I have to install the script menu, or is there a way to make it executable by double clicking (without having to answer a requester)?
Thanks again for your help, Moonray!
( Last edited by Taipan; Feb 12, 2004 at 06:58 PM. )
     
Moonray
Mac Elite
Join Date: May 2001
Status: Offline
Reply With Quote
Feb 13, 2004, 04:38 AM
 
Oops I should have mentioned that enable thingy, sorry didn't think of that. The hyphen should work, but it's also okay to refer to the menu items by number.

Now how you want to start it is a matter of your personal preference. You can save it in the script editor as application (try "Save As..."). In the save box there are options to show a dialog each time before it runs and such (you don't want that). Saved as application you can doubleclick it or put it in the dock or start it with your favorite application starter just like any other application (bundle or not doesn't matter). Of course you can also use the script menu.

-
     
Taipan  (op)
Dedicated MacNNer
Join Date: Jul 2002
Location: Germany
Status: Offline
Reply With Quote
Feb 13, 2004, 10:47 AM
 
Originally posted by Moonray:
You can save it in the script editor as application (try "Save As..."). In the save box there are options to show a dialog each time before it runs and such (you don't want that). -
Oh man, it was late yesterday. I swear that option wasn't there when I was looking for it yesterday...
Thanks again!
     
Moonray
Mac Elite
Join Date: May 2001
Status: Offline
Reply With Quote
Feb 13, 2004, 09:58 PM
 
Heheh ... you're welcome.

-
     
   
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 06:00 PM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,