I have an Applescript which displays a dialog with a text field in it. I invoke that script via a trigger in Quicksilver.
At the moment the invokation of the trigger does not put the dialog box (ant therefore the text field) in focus, so I have to click on the box to activate it before I can type something. Is there a way to remedy the situatioin?
Although dialogs are part of the StandardAdditions, they’re displayed either by the application running the script or “ in a tell block “ by the addressed application. If possible, you need to get the currently frontmost application (if that’s the one responsible for the window) to display the dialog.
tell application (path to frontmost application as Unicode text)
display dialog "Enter message:" default answer "" buttons {"Cancel", "Ok"} default button "Ok"
end tell