• 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: How to start/restart the Finder from an AS app?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to start/restart the Finder from an AS app?


  • Subject: Re: How to start/restart the Finder from an AS app?
  • From: Clint Hoxie <email@hidden>
  • Date: Fri, 21 Dec 2007 16:07:17 -0700

Good addition. I have only been using AS for about a month, and have already, multiple times, needed to use that functionality to get what I wanted. (At least, that was the way that made sense to me. Maybe "need" isn't the right word.)

Clint
On Dec 21, 2007, at 3:58 PM, Christopher Nebel wrote:

On Dec 21, 2007, at 12:45 AM, Philip Aker wrote:

On 2007-12-20, at 19:30:49, Mark J. Reed wrote:

What's the mechanism behind the "Relaunch" button in the "Force Quit" dialog? Any way to hook into that from a script?

I don't know if there's a specific event. I've been using 'quit' and 'activate' for years.


ignoring application responses
	tell application "Finder" to quit
end ignoring

repeat
tell application "System Events"
if (name of every application process does not contain "Finder") then
exit repeat
end if
end tell
end repeat


tell application "Finder" to activate

"Relaunch" is probably doing exactly what Mr. Aker's script is doing: killing it and then waiting until it's dead. I should point out that that particular form of the question "is an application running", while popular and semantically correct, isn't quite the same as the real question. I prefer this:


	tell application "System Events"
		if not exists application process "Finder" ...

...and if you're using Leopard, you don't even need System Events:

	if application "Finder" is not running ...

I got tired of people asking how to tell whether or not an application was running, so I added a built-in "running" property to application objects.


--Chris Nebel AppleScript Engineering

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


This email sent to email@hidden

_______________________________________________ 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: 
 >Re: How to start/restart the Finder from an AS app? (From: "Stockly, Ed" <email@hidden>)
 >Re: How to start/restart the Finder from an AS app? (From: Christopher Nebel <email@hidden>)
 >Re: How to start/restart the Finder from an AS app? (From: "Mark J. Reed" <email@hidden>)
 >Re: How to start/restart the Finder from an AS app? (From: Philip Aker <email@hidden>)
 >Re: How to start/restart the Finder from an AS app? (From: Christopher Nebel <email@hidden>)

  • Prev by Date: Re: How to start/restart the Finder from an AS app?
  • Next by Date: Re: OS X, 10.1 and Above - Append PDF files Using Applescript
  • Previous by thread: Re: How to start/restart the Finder from an AS app?
  • Next by thread: What's all this stuff about "bundles"
  • Index(es):
    • Date
    • Thread