ダイアログを表示したい。これは機能しますが、フロントウィンドウになることはありません。もっとアラートサインのようにしたいと思います。そのため、ダイアログボックスにテキストを入力するときは、常に最初にクリックする必要があります。ダイアログを最前面のウィンドウとして表示し、テキストフィールドにカーソルをプリセットする方法はありますか?これが私のコードです:
display dialog "type password" buttons {"Submit!", "No"} default answer "" default button 1 with hidden answer
if the button returned of the result is "Submit!" then
set x to text returned of the result
if x is "Password" then
tell application "Firefox"
activate
end tell
else
tell application "Finder"
activate
say "wrong password"
end tell
end if
else
tell application "Finder"
activate
say "okay"
end tell
end if
ダイアログ表示命令の直前に、以下を使用してスクリプトをアクティブにします。
tell me to activate
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加