0

Is there any way or function that can be used to obtain the expose effect in Mac, when a button is clicked?

I tried searching, but I had no luck, so far.

apaderno
  • 28,547
  • 16
  • 75
  • 90
Radix
  • 3,639
  • 3
  • 31
  • 47

1 Answers1

2

There is no API for this. AFAIK the only way to do it is to use NSWorkspace to launch either the Exposé app (Mac OS X versions < 10.7) or the Mission Control app (Mac OS X versions >= 10.7).

This code uses the com.apple.exposelauncher bundle ID which is the same for all versions of Mac OS X that ship with Exposé:

[[NSWorkspace sharedWorkspace] launchAppWithBundleIdentifier:@"com.apple.exposelauncher" 
                                                     options:NSWorkspaceLaunchDefault 
                              additionalEventParamDescriptor:NULL 
                                            launchIdentifier:NULL];
Rob Keniger
  • 45,830
  • 6
  • 101
  • 134
  • Adding to Rob's comment, this works in applescript... tell application id "com.apple.exposelauncher" to launch. – regulus6633 Nov 24 '11 at 06:04
  • @Rob: Thanks for the reply it really helped but here's one more query that i had in my mind like could we have a script or some bundle identifier that would work like fn+f11 to show the desktop. – Radix Nov 24 '11 at 06:43