home *** CD-ROM | disk | FTP | other *** search
/ PC World 2006 February / PCWorld_2006-02_cd.bin / software / vyzkuste / triky / triky.exe / autoit-v3-setup.exe / Examples / notepad2.au3 < prev    next >
Text File  |  2004-01-14  |  1KB  |  49 lines

  1. ;
  2. ; AutoIt Version: 3.0
  3. ; Language:       English
  4. ; Platform:       Win9x/NT
  5. ; Author:         Jonathan Bennett (jon@hiddensoft.com)
  6. ;
  7. ; Script Function:
  8. ;   Opens Notepad, types in some text and then quits.
  9. ;   The text typed shows two ways of Sending special
  10. ;   characters
  11. ;
  12.  
  13.  
  14. ; Prompt the user to run the script - use a Yes/No prompt (4 - see help file)
  15. $answer = MsgBox(4, "AutoIt Example (English Only)", "This script will run Notepad type in some text and then quit.  Run?")
  16.  
  17.  
  18. ; Check the user's answer to the prompt (see the help file for MsgBox return values)
  19. ; If "No" was clicked (7) then exit the script
  20. If $answer = 7 Then
  21.     MsgBox(0, "AutoIt", "OK.  Bye!")
  22.     Exit
  23. EndIf
  24.  
  25.  
  26. ; Run Notepad
  27. Run("notepad.exe")
  28.  
  29.  
  30. ; Wait for the Notepad become active - it is titled "Untitled - Notepad" on English systems
  31. WinWaitActive("Untitled - Notepad")
  32.  
  33.  
  34. ; Now that the Notepad window is active type some special characters 
  35. Send("Sending some special characters:{ENTER 2}")
  36.  
  37. ; Do it the first way
  38. Send("First way: ")
  39. Send("{!}{^}{+}{#}")
  40. Send("{ENTER}")
  41.  
  42. ; Do it the second way (RAW mode, notice the second parameter is 1)
  43. Send("Second way: ")
  44. Send("!^+#", 1)
  45.  
  46. Send("{ENTER}{ENTER}Finished")
  47.  
  48. ; Finished!
  49.