humm.... well, my app is 10.5 only, so only G4s+ can run it (i
think)... i just realized that if the finder is busy (copying, etc.)
it will not quit and the system will show the attached message.  my
procedure was this:

- execute action
- quit finder
- relaunch finder

but i've realized that if the finder is busy and can not quit, the
action will still execute wether the finder quits or not.  so, now my
procedure is this:

- quit finder
- execute action
- relaunch finder

i'm assuming that based on newer computers (G4+) and this new
procedure that i don't have to worry about the finder's quit delay?  i
realize this is still crude, but less likely to fail, no?

On Tue, Jan 13, 2009 at 6:30 PM, has <hengist.p...@virgin.net> wrote:
> Chunk 1978 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?
>
>
> Quitting an application and relaunching it immediately afterwards is a bit
> problematic as the 'quit' event will return before the application has
> finished terminating, with the result that you're trying to start up an
> application that's in the process of shutting down. Sticking in a delay is
> crude at best, and potentially unreliable as the time a process takes to
> terminate might vary. You might try getting the process's PID then
> repeatedly polling the system to see if that PID still exists, and only
> proceed with the relaunch once it ceases to be. (If you're in 10.5+,
> AppleScript's application objects have an 'is running' property, although I
> don't know if they do this or something else). To be honest, I'm not really
> sure what's best.
>
> HTH
>
> has
> --
> Control AppleScriptable applications from Python, Ruby and ObjC:
> http://appscript.sourceforge.net
>
>

<<attachment: Picture 1.jpg>>

_______________________________________________

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

Reply via email to