• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Quit Terminal
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Quit Terminal


  • Subject: Re: Quit Terminal
  • From: Emmanuel <email@hidden>
  • Date: Mon, 19 May 2003 17:40:02 +0200

At 11:09 PM +0800 19/05/03, Jerome Bachasson wrote:

>I want to write a script to quit the application Terminal, so I wrote :
>
>'tell app "Terminal" to quit'
>
>But every time I do that, the Terminal app, opens a warning window : "Are you sure you want to quit, bla bla bla". I' d like to override this, to quit the Terminal app with my script, without being asked if I really want to...

I use this, but I never tried to apply it to Terminal:

----------------------------------
on ELKillProcess(theProcess)
if theProcess's length > 16 then set theProcess to text 1 thru 16 of theProcess
try
do shell script (find text "^[[:space:]]*([0-9]+).*" & theProcess & "$" in (do shell script "ps -wxc") using "kill \\1" with regexp and string result)
0
on error
error (theProcess & " was not launched")
end try
end ELKillProcess
----------------------------------

For brevity this uses "find text" and thus requires either the Satimage osax or Smile (free software).

Emmanuel
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

References: 
 >Quit Terminal (From: Jerome Bachasson <email@hidden>)

  • Prev by Date: Re: Quit Terminal
  • Next by Date: Summary: Sounds on OS X
  • Previous by thread: Re: Quit Terminal
  • Next by thread: Re: Quit Terminal
  • Index(es):
    • Date
    • Thread