Generating AppleScript modal dlogs from a background app
Generating AppleScript modal dlogs from a background app
- Subject: Generating AppleScript modal dlogs from a background app
- From: John Scalo <email@hidden>
- Date: Sat, 17 Aug 2002 15:38:38 -0700
I have an app that is background only (LSUIElement == '1'), sometimes
generates windows, and sometimes these windows are AppleScript dialogs
resulting from OSAExecute calls. Since to my knowledge all AppleScript
dialogs are modal, I have to be very careful to make sure the dialogs are
visible, otherwise there's a window that the user can't see waiting for
input, which gives the appearance that the app has hung.
So, I call [NSApp activateIgnoringOtherApps:YES] before calling any
AppleScript which generates dialogs. Now here's the problem-
activateIgnoringOtherApps isn't guaranteed to bring the app to the front
immediately. I've found if the computer has been idle for more than about
five minutes, the app doesn't come to the front quick enough and the
AppleScript dialogs don't appear, so the app is essentially hung up.
How I can I ensure that the app is "ready" to display these modal dialogs?
[NSApp isActive] is no help because it always return YES right away. Same
with Carbon GetFrontProcess(). I'd rather not implement some arbitrary delay
if possible.
Thanks
- John
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.