Dialog Focus
  • I have a script that includes this snippet, but when I run it from a FastScripts hot key, the activate command does not always bring the dialog into focus. Is there a way to force that?

    on main()
    set theCommand to \"\"
    repeat while theCommand is \"\"
    display dialog \"View man page for this command:\" default answer theCommand
    set theCommand to text returned of result
    end repeat
    end main
  • Hi NovaScotian - keep in mind that the when AppleScript encounters the "display dialog" command, the script stops at that point until the user is done with the dialog. So your activate command is never encountered until *after* the dialog has been dismissed.

    FastScripts *should* be automatically activating the dialog for you when it comes up. If you have a reproduceable case where it doesn't do that, then maybe it's a bug and I'll try to track it down.

    But in the mean time if you want to try to encourage the activation to happen, put the "activate" command before the display dialog command, not before.

    Hope this helps,
  • That did it -- thanks.
Start a New Discussion

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!