Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

10.4: Hide frontmost application using Mighty Mouse System 10.4
Tiger only hintUsing Mighty Mouse (requires 10.4.2), you can set any of the actions to open a file, script, application, etc. So I set about making the squeeze action hide the frontmost application.

The AppleScript for this is fairly simple (though, like any AppleScript, I needed to start from similar code online).
tell application "System Events"
  set app_name to name of the second process whose frontmost is true
  set visible of process app_name to false
end tell
(In case you're curious, the reason why I use the second process is because that when the script is running, the first process is the script itself.)

Save the script as an 'application bundle' in ~/Library > Scripts. Open the application bundle that was created and open the Info.plist file in Property List Editor (Developer Tools required). Add an element LSUIElement with a string value of 1. This means that when we run the script, it won't pop up in the Dock.

Now open System Preferences > Keyboard & Mouse > Mouse, and set the squeeze action to Other... and navigate to the application bundle you just created.

Alternatively, you can just download the completed application from my website.
    •    
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)
 
[11,872 views]  

10.4: Hide frontmost application using Mighty Mouse | 7 comments | Create New Account
Click here to return to the '10.4: Hide frontmost application using Mighty Mouse' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.4: Hide frontmost application using Mighty Mouse
Authored by: hoffel on Jan 12, '06 06:53:57AM

I have been trying to write a script that would minimize all open windows to the dock, however, I seem to be severely scriptically challenged ;o)

Does anyone know how I could go about achieving this? It would just be to great to push a button and have a clear view on the desktop with all windows in the dock!

Can anyone help a lost Mac-comrade?

Hoffel.



[ Reply to This | # ]
10.4: Hide frontmost application using Mighty Mouse
Authored by: feelgood on Jan 12, '06 06:58:27AM

Can Mighty Mouse clicks not be assigned a key stroke? If so, couldn't you just assign it a command-H key stroke?



[ Reply to This | # ]
10.4: Hide frontmost application using Mighty Mouse
Authored by: DougAdams on Jan 12, '06 07:43:52AM

USB Overdrive works wonders with Mighty Mouse, allowing you to set an incredible variety of settings to the buttons, including keyboard shortcuts. There's a hint about it here somewhere I believe. Just make sure you remove the AppleHIDMouse.kext file from the Extensions folder. In fact, after upgrading to 10.4.4 I had to re-do this procedure.

---
Doug's AppleScripts for iTunes
http://www.dougscripts.com/itunes/



[ Reply to This | # ]
10.4: Hide frontmost application using Mighty Mouse
Authored by: el tumbador on Jan 12, '06 07:46:30AM

The advantage for me ist that I can use it not now to hide Adobe Illustrator, which hasn't a key-command for hiding.

The small programm is woking as promised, here in use with USB overdrive.

Thanks



[ Reply to This | # ]
10.4: Hide frontmost application using Mighty Mouse
Authored by: metiure on Jan 12, '06 03:01:46PM

Even simpler with Quickeys: just assigned a PowerBook key combo to this script from Quickeys, and the front app justs vanishes!



[ Reply to This | # ]
10.4: Hide frontmost application using Mighty Mouse
Authored by: Gee4orce on Mar 09, '07 07:13:12AM

Great tip, which allows me to get my favourite mouse shortcut working with my Mighty Mouse.

However, I had to change 'second' to 'first' in order to get it to work for me.



[ Reply to This | # ]
10.4: Hide frontmost application using Mighty Mouse
Authored by: c. on Jun 07, '07 02:53:39PM

The above script for me (MacBook) takes almost a whole second to do its job, which is slightly annoying. The following is simpler and considerably quicker:

tell application "System Events" to keystroke "h" using command down

The LSUIElement setting ensures that the script won't throw itself between you and your frontmost app, so no fiddling with process identities is needed.



[ Reply to This | # ]