applescript...simple question

Discussion in 'Mac Programming' started by aaagat111, Feb 14, 2008.

  1. macrumors regular

    Joined:
    Sep 12, 2005
    Location:
    St. Louis, MO
    #1
    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
     
  2. Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #2
    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
     

Share This Page