Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

aaagat111

macrumors regular
Original poster
Sep 12, 2005
204
0
St. Louis, MO
I want to write applescript code that will simply just close the active window, basically performing the apple + w command.


can anyone tell me how to do this.

Thank you very much

-Alex
 

kainjow

Moderator emeritus
Jun 15, 2000
7,958
7
Try this:

Code:
tell application "System Events" to set app_name to name ¬
	of the first process whose frontmost is true
tell application app_name to close front window
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.