Hi. I wrote a little bash script that runs in the background (launched by crontab) which uses osascript's (AppleScript's) 'display dialog' command to throw up a dialog box on my screen. Works great. Trouble is, the dialog box also takes the input focus. I want the dialog box to appear, but I don't want it to steal the input focus. Is this even possible? If not (as I suspect), how about this for a Plan B? Is it possible my background script could ... (1) detect and save the window ID or the app name that currently has input focus, (2) throw up the dialog box, then (3) give input focus back to where it was? If Plan B is possible, how to do (1) and (3)? [Title of this thread assumes Plan B.]
Context: This 'little bash script' is a custom reminder app. The dialog boxes, which remind me of my appointments, etc, have an input field. I can type things like '20m' (or '1900' or 'tue') into this input field, which my app will interpret as 'remind me again in 20 minutes' (or at 7pm or next Tuesday). Now, imagine this. I type a lot. I type fast. So it often happens that I'm typing something and suddenly my keystrokes show up inappropriately in the dialog box's input field. Grrr.
TIA for any help.
Context: This 'little bash script' is a custom reminder app. The dialog boxes, which remind me of my appointments, etc, have an input field. I can type things like '20m' (or '1900' or 'tue') into this input field, which my app will interpret as 'remind me again in 20 minutes' (or at 7pm or next Tuesday). Now, imagine this. I type a lot. I type fast. So it often happens that I'm typing something and suddenly my keystrokes show up inappropriately in the dialog box's input field. Grrr.
TIA for any help.