• 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: Killall Finder Brings Hidden Apps To Front?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Killall Finder Brings Hidden Apps To Front?


  • Subject: Re: Killall Finder Brings Hidden Apps To Front?
  • From: "Chunk 1978" <email@hidden>
  • Date: Tue, 13 Jan 2009 11:40:16 -0500

Repeat until exists process "Finder" is false?

i keep getting errors in applescript... can't get this right...

> You could use a repeat...
>
> Tell app "Finder" to quit
> Repeat until process "Finder" exists
>    Tell app "finder" to activate
>    Delay .25
> End
>
> I wrote this on an iphone so it's only close.
>
> Mark
>
>
>
> On Jan 13, 2009, at 8:11 AM, Chunk 1978 <email@hidden> wrote:
>
>> ok... so i've decided to use a simple apple script for this:
>>
>> tell application "Finder"
>>   quit
>>   delay 0.25
>>   launch
>> end tell
>>
>> or this (which i believe is the same thing)
>>
>> tell application "Finder"
>>   quit
>>   delay 0.25
>>   activate application "Finder"
>> end tell
>>
>> but i'd like to know about the delay.  without the delay... in this
>> script the delay works to save the finder's window state and then to
>> relaunch the finder.  should i be concerned about this delay on older,
>> slower computers?  should it be longer?
>>
>> if i write it like this:
>>
>> tell application "Finder"
>>   quit
>>   activate application "Finder"
>> end tell
>>
>> i will receive "Finder got an error:  connection is invalid" the
>> second time i load the script.  is this because there was no delay for
>> the finder to save stuff before it was quit?
>>
>> On Tue, Jan 13, 2009 at 7:56 AM, Chunk 1978 <email@hidden> wrote:
>>>
>>> i found this on apple's website, but i'm not sure if this is what you
>>> are talking about when you say using an apple event to quit the
>>> finder.  also, based on the description of the code, it doesn't seem
>>> like this will automatically relaunch finder after it has been quit.
>>>
>>> OSErr QuitFinder()
>>> {
>>>  int kFinderProcessSignature = 'MACS';
>>>  OSErr            anErr = paramErr;
>>>  AppleEvent        tAppleEvent = {typeNull,nil};
>>>  AppleEvent      tReply;
>>>  AEBuildError    tAEBuildError;
>>>
>>>  anErr = AEBuildAppleEvent(
>>>              kCoreEventClass, kAEQuitApplication,
>>>              typeApplSignature, &kFinderProcessSignature,
>>>              sizeof(OSType), kAutoGenerateReturnID,
>>>              kAnyTransactionID, &tAppleEvent,
>>>              &tAEBuildError,"");
>>>
>>>  if (noErr == anErr)
>>>  {
>>>      anErr = AESend( &tAppleEvent, &tReply, kAENoReply |
>>>                        kAENeverInteract, kAENormalPriority,
>>>                        kNoTimeOut, nil, nil );
>>>
>>>      (void) AEDisposeDesc(&tAppleEvent);
>>>  }
>>>  return anErr;
>>> }
>>>
>>>
>>> On Tue, Jan 13, 2009 at 1:16 AM, Kyle Sluder <email@hidden>
>>> wrote:
>>>>
>>>> On Tue, Jan 13, 2009 at 1:04 AM, Chunk 1978 <email@hidden> wrote:
>>>>>
>>>>> i have this code to relaunch the finder:
>>>>
>>>> Can't answer your question directly, but you should be sending Finder
>>>> a Quit Apple Event, not killing it.  And even if you want to kill it,
>>>> you should not be launching a task to do so.  And if you are going to
>>>> launch a task to do it, you shouldn't be using "killall Finder" to do
>>>> it.
>>>>
>>>> --Kyle Sluder
>>>>
>>>
>> _______________________________________________
>>
>> Cocoa-dev mailing list (email@hidden)
>>
>> Please do not post admin requests or moderator comments to the list.
>> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>>
>> Help/Unsubscribe/Update your Subscription:
>>
>> This email sent to email@hidden
>
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Killall Finder Brings Hidden Apps To Front? (From: "Chunk 1978" <email@hidden>)
 >Re: Killall Finder Brings Hidden Apps To Front? (From: "Kyle Sluder" <email@hidden>)
 >Re: Killall Finder Brings Hidden Apps To Front? (From: "Chunk 1978" <email@hidden>)
 >Re: Killall Finder Brings Hidden Apps To Front? (From: "Chunk 1978" <email@hidden>)
 >Re: Killall Finder Brings Hidden Apps To Front? (From: Mark Butler <email@hidden>)

  • Prev by Date: Re: Getting the network Machine Icon
  • Next by Date: Re: Killall Finder Brings Hidden Apps To Front?
  • Previous by thread: Re: Killall Finder Brings Hidden Apps To Front?
  • Next by thread: Re: Killall Finder Brings Hidden Apps To Front?
  • Index(es):
    • Date
    • Thread