• 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: List of open applications
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: List of open applications


  • Subject: Re: List of open applications
  • From: "koenig.yvan" <email@hidden>
  • Date: Thu, 06 Sep 2012 15:46:27 +0200

 Thanks a lot

Alas, quit doesn't behave here as it's supposed to do.

When the script asks Mail to quit, the menu item quit of the application switch to gray (disabled) but the script stops.
No process is reported as working in Activity Monitor but the only way to really quit is force quit.
I guess that something is weird but I don't know if it is the app, the system or an extraneous component.
What I'm sure of is that this behavior surfaced just after the update to 10.8.1 (used in French).

So, as long as I am running 10.8.1, I will stay with killall running this code :

--{SCRIPT]

# Get four localized strings
set p2pane to ((path to library folder from system domain as text) & "PreferencePanes:StartupDisk.prefPane") as alias
set btn1 to localized string "CANCEL" in bundle p2pane
set btn2 to localized string "RESTART" in bundle p2pane
set btn3 to localized string "SHUTDOWN" in bundle p2pane
set prompt to localized string "RESTART?" in bundle p2pane

if (system attribute "sysv") = 4225 then
# here we are running 10.8.1
tell application "System Events"
set visible of processes to true
set processusVisibles to name of processes whose visible is true and name is not "Finder" and name is not "Applescript Editor"
end tell


repeat with unProcessus in processusVisibles
do shell script "killall " & (quoted form of unProcessus)
end repeat
else
tell application "System Events"
set visible of processes to true
set processusVisibles to bundle identifier of processes whose visible is true and name is not "Finder" and name is not "Applescript Editor"
end tell


repeat with unProcessus in processusVisibles
tell application id unProcessus to quit
end repeat


end if
set queFaire to display dialog prompt buttons {btn1, btn2, btn3} default button 3

if button returned of queFaire is btn3 then
tell application "System Events" to shut down
else if button returned of queFaire is btn2 then
tell application "System Events" to restart
end if
--[/SCRIPT]

Yvan KOENIG (VALLAURIS, France) jeudi 6 septembre 2012 15:44:34

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

References: 
 >List of open applications (From: "koenig.yvan" <email@hidden>)
 >Re: List of open applications (From: Axel Luttgens <email@hidden>)
 >Re: List of open applications (From: "koenig.yvan" <email@hidden>)
 >Re: List of open applications (From: Axel Luttgens <email@hidden>)
 >Re: List of open applications (From: "koenig.yvan" <email@hidden>)
 >Re: List of open applications (From: Christopher Stone <email@hidden>)
 >Re: List of open applications (From: Christopher Stone <email@hidden>)

  • Prev by Date: Re: List of open applications
  • Next by Date: Re: XMLLib OSAX Questions
  • Previous by thread: Re: List of open applications
  • Next by thread: XMLLib OSAX Questions
  • Index(es):
    • Date
    • Thread