home *** CD-ROM | disk | FTP | other *** search
- ;;;;;;;;;;
- ;; Notepad Demo - NOTESAMP.SCT
- ;; Version 1.0
- ;;
- ;; Copyright 1993 Central Point Software, Inc.
- ;;
- ;;Purpose:
- ;; To demonstrate the use of the Notepad application with ScriptTools
- ;;
- ;;Commands Used:
- ;; FileExists(
- ;; GetEnvironment$(
- ;; MessageBox(
- ;; TopInstance(
- ;; Attach
- ;; EditText
- ;; Exec
- ;; Exit
- ;; If
- ;; Keyboard
- ;; MenuSelect
- ;; Mouse
- ;; MouseClick
- ;; MouseMove
- ;; Pause
- ;; Type
- ;;
- ;;;;;;;;;;
-
- WinDir$=GetEnvironment$("windir")
- if WinDir$="" then
- MessageBox("Error","Can't find Windows directory.",0)
- endif
-
- if FileExists(WinDir$+"\setup.txt")=0 then
- MessageBox("Error","This script requires a file called SETUP.TXT in your Windows directory. Exiting now.",0)
- Exit ;End the script so we don't get unwelcome dialog boxes
- endif
-
- Exec "Notepad" ;Run NOTEPAD.EXE
- NoteInst=TopInstance() ;Get instance number of new notepad.exe in case another copy is running
- Mouse OFF ;Temporarily disable user input
- Keyboard OFF
-
- Attach "NOTEPAD_Edit1",NoteInst
- Type "This script shows how ScriptTools works with Notepad.{Return}"
- pause 2 seconds
-
- Attach "NOTEPAD_Notepad",NoteInst
- ;;
- ;; Open a new file
- ;;
- Wk_New = 9
-
- ; Select "Wk_New" from the File menu
- MenuSelect Wk_New
- pause 2 sec
- Attach "NOTEPAD_Notepad",NoteInst
- Wk_No = 7
- Button Wk_No SingleClick
- pause 2 sec
- Attach "NOTEPAD_Edit1",NoteInst
- Type "This is a new file.{Return}"
- pause 2 seconds
-
- Attach "NOTEPAD_Notepad",NoteInst
- ;;
- ;; Open the file setup.txt
- ;;
- Wk_Open = 10
-
- ; Select "Wk_Open" from the Menu
- MenuSelect Wk_Open
- pause 2 sec
- Attach "NOTEPAD_Notepad",NoteInst
- Wk_No = 7
- Button Wk_No SingleClick
- pause 2 sec
- Attach "NOTEPAD_Open",NoteInst
- Wk_setuptxt = 1152
- EditText Wk_setuptxt WinDir$+"\setup.txt"
- pause 1 sec
- Wk_OK = 1
- Button Wk_OK SingleClick
-
- Attach "NOTEPAD_Edit1",NoteInst
- Type "{Return}"
- Type "{Up}This is an old file.{Return}"
- Pause 2 Seconds
- Type "{Return}"
-
- Attach "NOTEPAD_Notepad",NoteInst
- ;;
- ;; Use Save As function
- ;;
- Wk_SaveAs = 2
-
- ; Select "Wk_SaveAs" from the Menu
- MenuSelect Wk_SaveAs
-
- Attach "NOTEPAD_Save As",NoteInst
- Wk_1152 = 1152
- EditText Wk_1152 WinDir$+"\setup.txt"
- Pause 2 Seconds
- Wk_Cancel = 2
- Button Wk_Cancel SingleClick
-
- Attach "NOTEPAD_Edit1",NoteInst
- Type "That was the Save As function.{Return}"
- Pause 2 seconds
- Type "{Return}"
-
- Attach "NOTEPAD_Notepad",NoteInst
- ;;
- ;; Open Page Setup menu
- ;;
- Wk_PageSetup = 32
-
- ; Select "Wk_PageSetup" from the Menu
- MenuSelect Wk_PageSetup
-
- Attach "NOTEPAD_Page Setup",NoteInst
- Wk_f = 30
- EditText Wk_f "&f"
- pause 2 seconds
- Wk_OK = 1
- Button Wk_OK SingleClick
-
- Attach "NOTEPAD_Edit1",NoteInst
- Type "That was the Page Setup function.{Return}"
- Pause 2 seconds
-
- Attach "NOTEPAD_Notepad",NoteInst
- ;;
- ;; Open the print setup menu
- ;;
- Wk_PrintSetup = 31
-
- ; Select "Wk_PrintSetup" from the Menu
- MenuSelect Wk_PrintSetup
-
- Attach "NOTEPAD_Print Setup",NoteInst
- pause 2
-
- Wk_Cancel = 2
- Button Wk_Cancel SingleClick
-
- Attach "NOTEPAD_Edit1",NoteInst
- Type "{Return}"
- Type "That was the Printer Setup function.{Return}"
- Pause 5 seconds
-
- Attach "NOTEPAD_Notepad",NoteInst
- Wk_Exit = 28
-
- ; Select "Wk_Exit" from the Menu
- MenuSelect Wk_Exit
-
- Attach "NOTEPAD_Notepad",NoteInst
- Wk_No = 7
- Button Wk_No SingleClick
-
- exec "notepad"
- NoteInst=TopInstance();Get instance number of new notepad.exe
-
- Attach "NOTEPAD_Edit1", NoteInst
-
- Attach "NOTEPAD_Notepad", NoteInst
- Wk_Open = 10
-
- ; Select "Wk_Open" from the Menu
- MenuSelect Wk_Open
-
- Attach "NOTEPAD_Open", NoteInst
- Wk_setuptxt = 1152
- EditText Wk_setuptxt WinDir$+"\setup.txt"
- Wk_OK = 1
- Button Wk_OK SingleClick
-
- ;;
- ;; Cut and Paste example
- ;;
-
- Attach "NOTEPAD_Edit1", NoteInst
- MouseClick Left Button Down At 0, 8
- MouseMove 23 69
- MouseMove 55 109
- MouseMove 103 133
- MouseMove 159 138
- MouseMove 235 147
- MouseMove 301 152
- MouseMove 371 154
- MouseMove 375 153
- MouseMove 391 152
- MouseMove 405 144
- MouseMove 423 134
- MouseMove 426 132
- MouseMove 427 131
- MouseMove 427 130
- MouseMove 427 129
- MouseMove 428 129
- MouseMove 427 129
- MouseMove 427 130
- MouseClick Left Button Up At 427, 130
-
- Attach "NOTEPAD_Notepad", NoteInst
- Wk_CopyCtrlC = 769
- MenuSelect Wk_CopyCtrlC
-
- Attach "NOTEPAD_Edit1", NoteInst
- Type "{Return}"
- Type "{Return}"
-
- Attach "NOTEPAD_Notepad", NoteInst
- Wk_PasteCtrlV = 770
-
- ; Select "Wk_PasteCtrlV" from the Menu
- MenuSelect Wk_PasteCtrlV
-
- Attach "NOTEPAD_Edit1", NoteInst
- Type "{Return}"
- Type "That was copy and paste.{Return}"
- pause 2 seconds
-
- Attach "NOTEPAD_Notepad", NoteInst
- ;;
- ;; Find Function
- ;;
- Wk_Find = 3
-
- ; Select "Wk_Find" from the Menu
- MenuSelect Wk_Find
- Pause 2
- Attach "NOTEPAD_Find", NoteInst
- Wk_document = 1152
- EditText Wk_document "screen"
- Pause 1
- Wk_FindNext = 1
- Button Wk_FindNext SingleClick
- Pause 1
- Wk_Cancel = 2
- Button Wk_Cancel SingleClick
-
- Attach "NOTEPAD_Edit1", NoteInst
-
- Attach "NOTEPAD_Notepad", NoteInst
- Wk_FindNextF3 = 8
-
- ; Select "Wk_FindNextF3" from the Menu
- MenuSelect Wk_FindNextF3
-
- Attach "NOTEPAD_Edit1", NoteInst
- Type "{F3}{F3}{F3}{F3}{F3}{F3}{F3}{F3}{F3}{F3}{F3}{F3}{F3}{F3}{F3}{F3}{F3}{F3}"
-
- Attach "NOTEPAD_Notepad", NoteInst
- Wk_OK = 2
- Button Wk_OK SingleClick
-
- Attach "NOTEPAD_Edit1", NoteInst
- type"{Ctrl}{Home}That was the Find function.{Return}"
- Pause 2
-
- Attach "NOTEPAD_Notepad", NoteInst
- ;;
- ;; Open About menu
- ;;
-
- Wk_AboutNotepad = 11
-
- ; Select "Wk_AboutNotepad" from the Menu
- MenuSelect Wk_AboutNotepad
- Pause 2 seconds
-
- Attach "NOTEPAD_About Notepad", NoteInst
- Wk_OK = 1
- Button Wk_OK SingleClick
-
- Attach "NOTEPAD_Edit1", NoteInst
- Type "That was the About Notepad dialog box.{Return}{Return}"
- Pause 2
- Type "I hope you enjoyed the show. {Return}{Return}Goodbye for now."
- ;;
- ;; Exit from Notepad, then end the script
- ;;
- Attach "NOTEPAD_Notepad", NoteTest
- Wk_Exit = 28
-
- ; Select "Wk_Exit" from the Menu
- MenuSelect Wk_Exit
-
- Attach "NOTEPAD_Notepad", NoteTest
- Wk_No = 7
- Button Wk_No SingleClick
-
- Mouse ON
- Keyboard ON