ok thank you all for your help... i'm now convinced this is a better option than force quitting the finder
On Tue, Jan 13, 2009 at 11:54 AM, Mark Butler <marku...@mac.com> wrote: > Hi Chuck, > hmm.. no this has no logic to deal with the finder being busy > This is only making sure the the Finder exists before relaunching... > I dont believe that tell app "Finder" to quit will return until it > successfully does. > If you expect there may be some finder things going on this will likely > timeout. > You could wrap the tell app finder to quit in something to deal with that. > > tell application "Finder" > with timeout of 999999 seconds > quit > end timeout > end tell > > or > repeat > try > tell application "Finder" to quit > exit repeat > end try > delay 0.25 > end repeat > Mark > > On Jan 13, 2009, at 8:43 AM, Chunk 1978 wrote: > > ok... so in this script it's basically assuring that if anything is > using the finder or being copied, it will end so the finder will > relaunch? or is this script allowing finder processes to finish > before the finder relaunch? > > On Tue, Jan 13, 2009 at 11:39 AM, Mark Butler <marku...@mac.com> wrote: > > Sorry not quite that simple how about... > > tell application "Finder" to quit > > set theProcess to {} > > repeat > > try > > tell application "System Events" to tell application "Finder" > > to activate > > end try > > delay 0.25 > > tell application "System Events" to set theProcesses to name of every > > process > > if theProcesses contains "Finder" then exit repeat > > end repeat > > Mark > > On Jan 13, 2009, at 4:56 AM, Chunk 1978 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 <kyle.slu...@gmail.com> > > wrote: > > On Tue, Jan 13, 2009 at 1:04 AM, Chunk 1978 <chunk1...@gmail.com> 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 (Cocoa-dev@lists.apple.com) > > 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: > > http://lists.apple.com/mailman/options/cocoa-dev/markusca%40mac.com > > This email sent to marku...@mac.com > > > > _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com