#include ; ; AutoIt Version: 3.0 ; Language: English ; Platform: Win9x/NT ; Author: Jonathan Bennett (jon at autoitscript dot com) ; ; Script Function: ; Opens Notepad, types in some text and then quits the application. ; ; Prompt the user to run the script - use a Yes/No prompt with the flag parameter set at 4 (see the help file for more details) ;Local $iAnswer = MsgBox(BitOR($MB_YESNO, $MB_SYSTEMMODAL), "AutoIt Example", "This script will run Notepad, type in some text and then quit. Do you want to run it?") ; Check the user's answer to the prompt (see the help file for MsgBox return values) ; If "No" was clicked (7) then exit the script ;If $iAnswer = 7 Then ;MsgBox($MB_SYSTEMMODAL, "AutoIt", "OK. Bye!") ;Exit ;EndIf ; Run MusicBee Run("C:\Program Files\MusicBee\MusicBee2.exe") ; Wait for the Notepad to become active. The classname "Notepad" is monitored instead of the window title ;WinWaitActive("[CLASS:MusicBee]") ; Now that the Notepad window is active type some text Sleep(3000) Send("f") ; Finished!