Macro Scheduler Manual

283
Macro Scheduler Windows Automation Made Easy © 2014 MJT Net Ltd All rights reserved. No parts of this work may be reproduced in any form or by any means - graphic, electronic, or mechanical, including photocopying, recording, taping, or information storage and retrieval systems - without the written permission of the publisher. Products that are referred to in this document may be either trademarks and/or registered trademarks of the respective owners. The publisher and the author make no claim to these trademarks. While every precaution has been taken in the preparation of this document, the publisher and the author assume no responsibility for errors or omissions, or for damages resulting from the use of information contained in this document or from the use of programs and source code that may accompany it. In no event shall the publisher and the author be liable for any loss of profit or any other commercial damage caused or alleged to have been caused directly or indirectly by this document. Web: Email: Phone: Fax: http://www.mjtnet.com/ [email protected] +44 8700 684 523 +1 360 519 5383 +44 709 214 3231 +1 866 788 7502

description

Macro Scheduler Manual to automate web

Transcript of Macro Scheduler Manual

  • Macro SchedulerWindows Automation Made Easy

    2014 MJT Net Ltd

    All rights reserved. No parts of this work may be reproduced in any form or by any means- graphic, electronic, or mechanical, including photocopying, recording, taping, orinformation storage and retrieval systems - without the written permission of thepublisher.

    Products that are referred to in this document may be either trademarks and/orregistered trademarks of the respective owners. The publisher and the author make noclaim to these trademarks.

    While every precaution has been taken in the preparation of this document, the publisherand the author assume no responsibility for errors or omissions, or for damagesresulting from the use of information contained in this document or from the use ofprograms and source code that may accompany it. In no event shall the publisher andthe author be liable for any loss of profit or any other commercial damage caused oralleged to have been caused directly or indirectly by this document.

    Web:

    Email:

    Phone:

    Fax:

    http://www.mjtnet.com/

    [email protected]

    +44 8700 684 523+1 360 519 5383

    +44 709 214 3231+1 866 788 7502

  • Macro SchedulerI

    2014 MJT Net Ltd

    Table of ContentsPart I Using Macro Scheduler 2

    ................................................................................................................................... 21 Getting Started

    ................................................................................................................................... 32 Menu Commands

    ................................................................................................................................... 43 Toolbar

    ................................................................................................................................... 44 Creating Scripts

    ................................................................................................................................... 65 Backing up your Scripts and Settings

    ................................................................................................................................... 96 Using Variables ................................................................................................................................... 107 Code Builder ................................................................................................................................... 108 Code Wizards ................................................................................................................................... 119 Code Snippets ................................................................................................................................... 1210 Code Folding and Bookmarks ................................................................................................................................... 1211 Scheduling Scripts ................................................................................................................................... 1512 Advanced Scheduling ................................................................................................................................... 1613 Trigger ................................................................................................................................... 1714 AutoLogon ................................................................................................................................... 1815 Logging ................................................................................................................................... 1816 Encryption ................................................................................................................................... 1917 Hot Keys ................................................................................................................................... 1918 Groups ................................................................................................................................... 2019 Stats ................................................................................................................................... 2020 Recording Macros ................................................................................................................................... 2121 Playing Scripts And Macros ................................................................................................................................... 2222 Creating Desktop Shortcuts ................................................................................................................................... 2223 Using the Debugger ................................................................................................................................... 2424 Dialog Designer ................................................................................................................................... 2525 WebRecorder ................................................................................................................................... 2626 Command Line Options ................................................................................................................................... 2827 Help and Resources

    Part II Menu Commands 31................................................................................................................................... 311 New Macro ................................................................................................................................... 312 New Macro From Template ................................................................................................................................... 313 Edit Macro ................................................................................................................................... 314 Import Macros ................................................................................................................................... 325 Hide ................................................................................................................................... 326 Exit ................................................................................................................................... 327 Delete ................................................................................................................................... 328 Remove from Group ................................................................................................................................... 329 Rename

  • IIContents

    2014 MJT Net Ltd

    ................................................................................................................................... 3210 Select All

    ................................................................................................................................... 3211 New Group

    ................................................................................................................................... 3312 Delete Group

    ................................................................................................................................... 3313 Group Properties

    ................................................................................................................................... 3314 Sort

    ................................................................................................................................... 3315 Font

    ................................................................................................................................... 3416 Grid Lines

    ................................................................................................................................... 3417 List

    ................................................................................................................................... 3418 Details

    ................................................................................................................................... 3419 Large Buttons

    ................................................................................................................................... 3420 Toolbar

    ................................................................................................................................... 3421 Search Bar

    ................................................................................................................................... 3422 Create Exe

    ................................................................................................................................... 3623 View Log File

    ................................................................................................................................... 3624 Desktop Shortcut

    ................................................................................................................................... 3625 View System Windows

    ................................................................................................................................... 3726 Options

    ................................................................................................................................... 3827 Run Now

    ................................................................................................................................... 3828 Record

    ................................................................................................................................... 3829 Stop

    ................................................................................................................................... 3830 Contents

    ................................................................................................................................... 3831 Check for Update

    ................................................................................................................................... 3832 Support Forums

    ................................................................................................................................... 3933 About

    Part III Scripting Windows For Beginners41

    ................................................................................................................................... 411 Introduction

    ................................................................................................................................... 412 Requirements

    ................................................................................................................................... 413 The Problem

    ................................................................................................................................... 414 Using Macro Scheduler

    ................................................................................................................................... 425 First Steps

    ................................................................................................................................... 426 Building The Script ......................................................................................................................................................... 44Run Notepad ......................................................................................................................................................... 44Wait for the w indow "Untitled Notepad" ......................................................................................................................................................... 44Send our lines of text ......................................................................................................................................................... 46Press ALT-FA ......................................................................................................................................................... 46Wait for the w indow "Save As" ......................................................................................................................................................... 46Send our filename ......................................................................................................................................................... 48The Script So Far ......................................................................................................................................................... 49Printing the Document ......................................................................................................................................................... 50Closing Notepad

    ................................................................................................................................... 507 The Complete Script

    ................................................................................................................................... 528 Where To Go From Here

  • Macro SchedulerIII

    2014 MJT Net Ltd

    Part IV Command Reference 54................................................................................................................................... 541 Complex Expressions

    ......................................................................................................................................................... 54Arithmetic Operators

    ......................................................................................................................................................... 55Logical Operators

    ......................................................................................................................................................... 55String Operators

    ......................................................................................................................................................... 55Relational Operators

    ......................................................................................................................................................... 55Arithmetic Functions

    ......................................................................................................................................................... 56String Functions

    ......................................................................................................................................................... 57Conditional Functions

    ......................................................................................................................................................... 57Examples ................................................................................................................................... 582 Clipboard Commands

    ......................................................................................................................................................... 58GetClipBoard

    ......................................................................................................................................................... 58PutClipBoard

    ......................................................................................................................................................... 58WaitClipBoard ................................................................................................................................... 593 Console App Funtions

    ......................................................................................................................................................... 59SOWrite

    ......................................................................................................................................................... 59SOWriteLn ................................................................................................................................... 594 Database Commands

    ......................................................................................................................................................... 59DBClose

    ......................................................................................................................................................... 60DBConnect

    ......................................................................................................................................................... 60DBExec

    ......................................................................................................................................................... 61DBQuery ................................................................................................................................... 625 Date/Time Commands

    ......................................................................................................................................................... 62DateAdd

    ......................................................................................................................................................... 63DateDiff

    ......................................................................................................................................................... 63DateLocal

    ......................................................................................................................................................... 63DatePart

    ......................................................................................................................................................... 64DateStamp

    ......................................................................................................................................................... 64Day

    ......................................................................................................................................................... 64DayOfWeek

    ......................................................................................................................................................... 65GetDate

    ......................................................................................................................................................... 66GetTime

    ......................................................................................................................................................... 66Hour

    ......................................................................................................................................................... 66Min

    ......................................................................................................................................................... 67Month

    ......................................................................................................................................................... 67Sec

    ......................................................................................................................................................... 67TimeAdd

    ......................................................................................................................................................... 68TimeDiff

    ......................................................................................................................................................... 68TimePart

    ......................................................................................................................................................... 68TimeLocal

    ......................................................................................................................................................... 69Timer

    ......................................................................................................................................................... 69TimeStamp

    ......................................................................................................................................................... 69Year ................................................................................................................................... 706 DDE Commands

    ......................................................................................................................................................... 70DDEPoke

    ......................................................................................................................................................... 70DDERequest ................................................................................................................................... 707 Dialogs

    ......................................................................................................................................................... 71Dialog Objects .................................................................................................................................................. 71File Brow se Buttons.................................................................................................................................................. 72Button Object Properties.................................................................................................................................................. 73Form Properties.................................................................................................................................................. 76MainMenu - Menu Builder.................................................................................................................................................. 76Label Object Properties.................................................................................................................................................. 78Edit Object Properties

  • IVContents

    2014 MJT Net Ltd

    .................................................................................................................................................. 79Memo Object Properties

    .................................................................................................................................................. 81CheckBox Object Properties

    .................................................................................................................................................. 83ListBox Object Properties

    .................................................................................................................................................. 85ComboBox Object Properties

    .................................................................................................................................................. 87Image Object Properties

    .................................................................................................................................................. 88RadioGroup Object Properties

    .................................................................................................................................................. 90ProgressBar Object Properties

    .................................................................................................................................................. 91PageControl Object Properties

    .................................................................................................................................................. 93TabSheet Object Properties

    .................................................................................................................................................. 94Panel Object Properties

    .................................................................................................................................................. 96Splitter Object Properties

    .................................................................................................................................................. 97StatusBar Object Properties

    .................................................................................................................................................. 98StringGrid Object Properties.................................................................................................................................................. 100MenuItem Object Properties.................................................................................................................................................. 101HTMLView er Object Properties

    ......................................................................................................................................................... 101Dialog Functions .................................................................................................................................................. 102CloseDialog.................................................................................................................................................. 102Dialog.................................................................................................................................................. 102EndDialog.................................................................................................................................................. 103GetDialogAction.................................................................................................................................................. 103PrintDialog.................................................................................................................................................. 103ResetDialogAction.................................................................................................................................................. 103SetDialogObjectColor.................................................................................................................................................. 104SetDialogObjectFont.................................................................................................................................................. 104SetDialogObjectFocus.................................................................................................................................................. 105SetDialogObjectVisible.................................................................................................................................................. 105Show.................................................................................................................................................. 105GetDialogProperty.................................................................................................................................................. 106SetDialogProperty.................................................................................................................................................. 106AddDialogHandler

    ......................................................................................................................................................... 107Dialog Examples

    ......................................................................................................................................................... 107Modal vs Non-Modal Dialogs ................................................................................................................................... 1098 Excel Functions

    ......................................................................................................................................................... 109XLAddSheet

    ......................................................................................................................................................... 109XLCreate

    ......................................................................................................................................................... 110XLDelCol

    ......................................................................................................................................................... 110XLDelRow

    ......................................................................................................................................................... 111XLDelSheet

    ......................................................................................................................................................... 111XLGetCell

    ......................................................................................................................................................... 112XLGetSheetDims

    ......................................................................................................................................................... 112XLOpen

    ......................................................................................................................................................... 112XLQuit

    ......................................................................................................................................................... 113XLRun

    ......................................................................................................................................................... 113XLSave

    ......................................................................................................................................................... 114XLSetCell

    ......................................................................................................................................................... 114XLSheetToArray ................................................................................................................................... 1159 File Handling

    ......................................................................................................................................................... 115AppendFile

    ......................................................................................................................................................... 115ChangeDirectory

    ......................................................................................................................................................... 116CopyFile

    ......................................................................................................................................................... 116CountFiles

    ......................................................................................................................................................... 117CreateDir

    ......................................................................................................................................................... 117CSVFileToArray

    ......................................................................................................................................................... 118DeleteFile

    ......................................................................................................................................................... 119EditIniFile

    ......................................................................................................................................................... 119FileDate

    ......................................................................................................................................................... 119FileSize

  • Macro SchedulerV

    2014 MJT Net Ltd

    ......................................................................................................................................................... 120FileTime

    ......................................................................................................................................................... 120GetFileList

    ......................................................................................................................................................... 121GetNewestFile

    ......................................................................................................................................................... 121GetOldestFile

    ......................................................................................................................................................... 121IfDirExists

    ......................................................................................................................................................... 122IfFileChanged

    ......................................................................................................................................................... 122IfFileExists

    ......................................................................................................................................................... 123IfNotDirExists

    ......................................................................................................................................................... 123IfNotFileChanged

    ......................................................................................................................................................... 124IfNotFileExists

    ......................................................................................................................................................... 124MoveFile

    ......................................................................................................................................................... 125ReadFile

    ......................................................................................................................................................... 125ReadIniFile

    ......................................................................................................................................................... 126ReadLn

    ......................................................................................................................................................... 126RenameFile

    ......................................................................................................................................................... 127WriteLn

    ......................................................................................................................................................... 127ZipAddFiles

    ......................................................................................................................................................... 128ZipExtractFiles ................................................................................................................................... 12810 FTP/HTTP/Telnet/Email Commands

    ......................................................................................................................................................... 128FTPDelFile

    ......................................................................................................................................................... 129FTPGetDirList

    ......................................................................................................................................................... 130FTPGetFile

    ......................................................................................................................................................... 131FTPMakeDir

    ......................................................................................................................................................... 132FTPPutFile

    ......................................................................................................................................................... 133FTPRemoveDir

    ......................................................................................................................................................... 134FTPRenameFile

    ......................................................................................................................................................... 135HTTPRequest

    ......................................................................................................................................................... 137IsConnectedToInternet

    ......................................................................................................................................................... 137IEGetTags

    ......................................................................................................................................................... 138IEGetTagsByAttrib

    ......................................................................................................................................................... 138IETagEvent

    ......................................................................................................................................................... 139IETagEventByAttrib

    ......................................................................................................................................................... 140IEWait

    ......................................................................................................................................................... 140RetrievePOP3

    ......................................................................................................................................................... 141SMTPSendMail

    ......................................................................................................................................................... 142TelnetClose

    ......................................................................................................................................................... 142TelnetConnect

    ......................................................................................................................................................... 143TelnetSend

    ......................................................................................................................................................... 144TelnetWaitFor ................................................................................................................................... 14411 Conditional Commands (If...)

    ......................................................................................................................................................... 144If

    ......................................................................................................................................................... 145IfDirExists

    ......................................................................................................................................................... 146IfFileChanged

    ......................................................................................................................................................... 146IfFileExists

    ......................................................................................................................................................... 147IfNot

    ......................................................................................................................................................... 147IfNotDirExists

    ......................................................................................................................................................... 148IfNotFileChanged

    ......................................................................................................................................................... 148IfNotFileExists

    ......................................................................................................................................................... 149IfNotWindowOpen

    ......................................................................................................................................................... 149IfWindowOpen ................................................................................................................................... 15012 Image Recognition

    ......................................................................................................................................................... 150CompareBitmaps

    ......................................................................................................................................................... 150FindImagePos

    ......................................................................................................................................................... 152GetPixelColor

    ......................................................................................................................................................... 153GetRectCheckSum

    ......................................................................................................................................................... 153GetScreenRes

    ......................................................................................................................................................... 154ScreenCapture

  • VIContents

    2014 MJT Net Ltd

    ......................................................................................................................................................... 154WaitPixelColor

    ......................................................................................................................................................... 155WaitRectChanged

    ......................................................................................................................................................... 155WaitScreenImage ................................................................................................................................... 15613 Keyboard Commands

    ......................................................................................................................................................... 156Ascii

    ......................................................................................................................................................... 156CapsOff

    ......................................................................................................................................................... 156CapsOn

    ......................................................................................................................................................... 157NumOff

    ......................................................................................................................................................... 157NumOn

    ......................................................................................................................................................... 157ObjectSendKeys

    ......................................................................................................................................................... 157ObjectSendText

    ......................................................................................................................................................... 158Press ...

    ......................................................................................................................................................... 159Release ...

    ......................................................................................................................................................... 160ScrollOff

    ......................................................................................................................................................... 160ScrollOn

    ......................................................................................................................................................... 160SendText

    ......................................................................................................................................................... 161WaitKeyDown ................................................................................................................................... 16114 Loops and Branching

    ......................................................................................................................................................... 161EndWhile

    ......................................................................................................................................................... 162Gosub

    ......................................................................................................................................................... 162Goto

    ......................................................................................................................................................... 163Label

    ......................................................................................................................................................... 163Repeat

    ......................................................................................................................................................... 164SkipLabel

    ......................................................................................................................................................... 165Until

    ......................................................................................................................................................... 165While ................................................................................................................................... 16615 Messages

    ......................................................................................................................................................... 166Ask

    ......................................................................................................................................................... 166Input

    ......................................................................................................................................................... 167Message

    ......................................................................................................................................................... 167MessageModal ................................................................................................................................... 16816 Miscellaneous

    ......................................................................................................................................................... 168AddTrayHandler

    ......................................................................................................................................................... 169AddTrayIcon

    ......................................................................................................................................................... 169ArrayCount

    ......................................................................................................................................................... 169ArrayDim

    ......................................................................................................................................................... 170ArraySort

    ......................................................................................................................................................... 170ColorToRGB

    ......................................................................................................................................................... 171DelArray

    ......................................................................................................................................................... 171DelTrayIcon

    ......................................................................................................................................................... 171DelVariable

    ......................................................................................................................................................... 171BlockInput

    ......................................................................................................................................................... 172ExportData

    ......................................................................................................................................................... 172GetEnvVar

    ......................................................................................................................................................... 173KillProcess

    ......................................................................................................................................................... 173LibFree

    ......................................................................................................................................................... 173LibFunc

    ......................................................................................................................................................... 175LibFuncW

    ......................................................................................................................................................... 175LibLoad

    ......................................................................................................................................................... 176ModTrayIcon

    ......................................................................................................................................................... 176PlayWav

    ......................................................................................................................................................... 176PopupMenu

    ......................................................................................................................................................... 177ProcessExists

    ......................................................................................................................................................... 177Random

    ......................................................................................................................................................... 177RGB

    ......................................................................................................................................................... 178SetEnvVar

  • Macro SchedulerVII

    2014 MJT Net Ltd

    ......................................................................................................................................................... 178WaitCursorChanged

    ......................................................................................................................................................... 178WaitProcessExists

    ......................................................................................................................................................... 179WaitProcessTerminated

    ......................................................................................................................................................... 179Wow64DisableRedirection

    ......................................................................................................................................................... 180Wow64EnableRedirection ................................................................................................................................... 18017 Mouse Commands

    ......................................................................................................................................................... 180GetCaretPos

    ......................................................................................................................................................... 180GetCursorPos

    ......................................................................................................................................................... 181LClick

    ......................................................................................................................................................... 181LDblClick

    ......................................................................................................................................................... 181LDown

    ......................................................................................................................................................... 181LUp

    ......................................................................................................................................................... 182MClick

    ......................................................................................................................................................... 182MDblClick

    ......................................................................................................................................................... 182MDown

    ......................................................................................................................................................... 182MouseMove

    ......................................................................................................................................................... 183MouseMoveRel

    ......................................................................................................................................................... 183MouseOver

    ......................................................................................................................................................... 184MUp

    ......................................................................................................................................................... 184RClick

    ......................................................................................................................................................... 184RDblClick

    ......................................................................................................................................................... 185RDown

    ......................................................................................................................................................... 185RUp

    ......................................................................................................................................................... 185Toolbar ................................................................................................................................... 18618 Numeric Functions

    ......................................................................................................................................................... 186Add

    ......................................................................................................................................................... 186Let

    ......................................................................................................................................................... 187SetRoundMode

    ......................................................................................................................................................... 188Sub ................................................................................................................................... 18819 Registry Functions

    ......................................................................................................................................................... 188RegistryDelKey

    ......................................................................................................................................................... 189RegistryDelVal

    ......................................................................................................................................................... 189RegistryEnumKeys

    ......................................................................................................................................................... 189RegistryEnumVals

    ......................................................................................................................................................... 190RegistryReadKey

    ......................................................................................................................................................... 190RegistryWriteKey ................................................................................................................................... 19020 Running Programs/Files

    ......................................................................................................................................................... 191ExecuteFile

    ......................................................................................................................................................... 191RunProgram ................................................................................................................................... 19221 Script Control

    ......................................................................................................................................................... 193Sub Routines .................................................................................................................................................. 193Gosub.................................................................................................................................................. 193SRT.................................................................................................................................................. 194END.................................................................................................................................................. 195SkipLabel

    ......................................................................................................................................................... 195Assigned

    ......................................................................................................................................................... 196EndWhile

    ......................................................................................................................................................... 196Exit

    ......................................................................................................................................................... 196Goto

    ......................................................................................................................................................... 197If

    ......................................................................................................................................................... 198IfNot

    ......................................................................................................................................................... 198Include

    ......................................................................................................................................................... 199IncludeFromVar

    ......................................................................................................................................................... 199Label

    ......................................................................................................................................................... 199Let

    ......................................................................................................................................................... 200Macro

  • VIIIContents

    2014 MJT Net Ltd

    ......................................................................................................................................................... 201OnEvent

    ......................................................................................................................................................... 204Remark

    ......................................................................................................................................................... 204Repeat

    ......................................................................................................................................................... 205Until

    ......................................................................................................................................................... 205Wait

    ......................................................................................................................................................... 206WaitReady

    ......................................................................................................................................................... 206While ................................................................................................................................... 20722 String Handling

    ......................................................................................................................................................... 207AESEncrypt

    ......................................................................................................................................................... 208Base64

    ......................................................................................................................................................... 208ConCat

    ......................................................................................................................................................... 208Crypt

    ......................................................................................................................................................... 209ExtractFileExt

    ......................................................................................................................................................... 210ExtractFileName

    ......................................................................................................................................................... 210ExtractFilePath

    ......................................................................................................................................................... 210Hash

    ......................................................................................................................................................... 211HTMLDecode

    ......................................................................................................................................................... 211HTMLEncode

    ......................................................................................................................................................... 211LabelToVar

    ......................................................................................................................................................... 212Length

    ......................................................................................................................................................... 212LowerCase

    ......................................................................................................................................................... 212LTrim

    ......................................................................................................................................................... 212MidStr

    ......................................................................................................................................................... 213Position

    ......................................................................................................................................................... 213RegEx

    ......................................................................................................................................................... 214RTrim

    ......................................................................................................................................................... 214Separate

    ......................................................................................................................................................... 214StringReplace

    ......................................................................................................................................................... 215Trim

    ......................................................................................................................................................... 215UpperCase ................................................................................................................................... 21523 Text Capture

    ......................................................................................................................................................... 215GetControlText

    ......................................................................................................................................................... 216GetTextAtPoint

    ......................................................................................................................................................... 216GetTextInit

    ......................................................................................................................................................... 217GetTextInRect

    ......................................................................................................................................................... 217GetTextPos

    ......................................................................................................................................................... 218GetTextReset

    ......................................................................................................................................................... 218GetWindowText

    ......................................................................................................................................................... 218GetWindowTextEx

    ......................................................................................................................................................... 219WaitScreenText ................................................................................................................................... 21924 VBScript Commands

    ......................................................................................................................................................... 219VBEND

    ......................................................................................................................................................... 220VBEval

    ......................................................................................................................................................... 221VBSTART

    ......................................................................................................................................................... 222VBRun ................................................................................................................................... 22325 WebRecorder Functions

    ......................................................................................................................................................... 223IEClickTag

    ......................................................................................................................................................... 224IEContainsText

    ......................................................................................................................................................... 224IECreate

    ......................................................................................................................................................... 224IEExtractTable

    ......................................................................................................................................................... 225IEExtractTableByName

    ......................................................................................................................................................... 225IEExtractTag

    ......................................................................................................................................................... 225IEExtractTagByAttrib

    ......................................................................................................................................................... 226IEExtractTagByName

    ......................................................................................................................................................... 226IEFormFill

    ......................................................................................................................................................... 227IEFormSubmit

  • Macro SchedulerIX

    2014 MJT Net Ltd

    ......................................................................................................................................................... 228IEGetFromURL

    ......................................................................................................................................................... 228IEGetHWND

    ......................................................................................................................................................... 228IEGetTagPos

    ......................................................................................................................................................... 229IEGetURL

    ......................................................................................................................................................... 229IEGoBack

    ......................................................................................................................................................... 229IEGoForward

    ......................................................................................................................................................... 230IENavigate

    ......................................................................................................................................................... 230IEOnDownload

    ......................................................................................................................................................... 231IEQuit

    ......................................................................................................................................................... 231IERefresh

    ......................................................................................................................................................... 231IESetTimeout

    ......................................................................................................................................................... 232IEShowIE

    ......................................................................................................................................................... 232IEWait

    ......................................................................................................................................................... 232IEWaitDocumentComplete

    ......................................................................................................................................................... 233IEWaitFileDownload

    ......................................................................................................................................................... 233IEWaitForText

    ......................................................................................................................................................... 233IEWaitTimeout

    ......................................................................................................................................................... 234IEWaitNew ................................................................................................................................... 23426 Window Functions

    ......................................................................................................................................................... 234CloseWindow

    ......................................................................................................................................................... 235FindWindowWithText

    ......................................................................................................................................................... 236GetActiveWindow

    ......................................................................................................................................................... 236GetWindowChildList

    ......................................................................................................................................................... 236GetWindowHandle

    ......................................................................................................................................................... 237GetWindowList

    ......................................................................................................................................................... 237GetWindowNames

    ......................................................................................................................................................... 238GetWindowParent

    ......................................................................................................................................................... 238GetWindowPos

    ......................................................................................................................................................... 239GetWindowProcess

    ......................................................................................................................................................... 239GetWindowSize

    ......................................................................................................................................................... 240GetWindowText

    ......................................................................................................................................................... 240IfWindowOpen

    ......................................................................................................................................................... 241IfNotWindowOpen

    ......................................................................................................................................................... 241MoveWindow

    ......................................................................................................................................................... 242ResizeWindow

    ......................................................................................................................................................... 243SetFocus

    ......................................................................................................................................................... 244ShutDownWindows

    ......................................................................................................................................................... 244WaitWindowChanged

    ......................................................................................................................................................... 244WaitWindowClosed

    ......................................................................................................................................................... 245WaitWindowFocused

    ......................................................................................................................................................... 246WaitWindowOpen

    ......................................................................................................................................................... 247WindowAction ................................................................................................................................... 24827 Window Objects

    ......................................................................................................................................................... 248FindObject

    ......................................................................................................................................................... 249GetCheckBox

    ......................................................................................................................................................... 249GetControlText

    ......................................................................................................................................................... 250GetFocusedObject

    ......................................................................................................................................................... 250GetListItem

    ......................................................................................................................................................... 251GetTreeNode

    ......................................................................................................................................................... 252PushButton

    ......................................................................................................................................................... 253SelectMenu

    ......................................................................................................................................................... 253SetCheckBox

    ......................................................................................................................................................... 254SetControlText

    ......................................................................................................................................................... 254SetObjectText

    ......................................................................................................................................................... 255UIAccessibleList

    ......................................................................................................................................................... 255UIClick

    ......................................................................................................................................................... 255UIFocus

  • XContents

    2014 MJT Net Ltd

    ......................................................................................................................................................... 256UIGetValue

    ......................................................................................................................................................... 256UIPos

    ......................................................................................................................................................... 257UISelect

    ......................................................................................................................................................... 257UISetValue ................................................................................................................................... 25728 Using Variables

    ......................................................................................................................................................... 258User Defined Variables

    ......................................................................................................................................................... 259Arrays

    ......................................................................................................................................................... 259Scope

    ......................................................................................................................................................... 261Explicit Variable Resolution - VAREXPLICIT

    ......................................................................................................................................................... 261Ignoring Spaces - IGNORESPACES

    ......................................................................................................................................................... 262System Variables

    ......................................................................................................................................................... 265Variable Explorer ................................................................................................................................... 26529 Error Handling

    Index 266

  • Using Macro Scheduler

    Part

    I

  • 2Using Macro Scheduler

    2014 MJT Net Ltd

    1 Using Macro Scheduler1.1 Getting Started

    When Macro Scheduler starts it places its icon in the system tray (next to the clock). The first timeMacro Scheduler is run it starts minimized. To view Macro Scheduler click on this icon (or doubleclick if you are still stuck using XP), or right click on the icon to display the pop up menu and select'Show'.

    Note: as of Macro Scheduler 14.1.03 the icon you will see in the tray is: Previous versions of Macro Scheduler used:

    If you like you can prevent Macro Scheduler from starting minimized. To do this select Tools/Optionsand uncheck 'Start Minimized'. See Options .

    This is the main control center for Macro Scheduler. From here macros can be started, recorded,deleted and edited.

    For further information on creating macros see Creating Scripts and Recording Macros

    Or see Menu Commands or Toolbars for an explanation of the menu options and toolbarbuttons.

    Access to the functions is through the toolbar buttons, the system menu or by double clicking on theappropriate macro, or right clicking on it to display a pop up menu.

    The search bar can be used to locate macros. Macro Scheduler searches the content of macros aswell as the macro names. Results will include macros which contain all of the words specified in thesearch, whatever their order. To search for a specific phrase include it in double quotes.

    37

    4 20

    3 4

  • 3 Macro Scheduler

    2014 MJT Net Ltd

    1.2 Menu Commands

    FileNew MacroNew Macro From TemplateEdit MacroImport MacrosHideExit

    EditDeleteRemove from GroupRenameSelect All

    GroupsNew GroupDelete GroupGroup Properties

    ViewSortFontGrid LinesListDetailsLarge ButtonsToolbarSearch Bar

    ToolsView Log FileCreate ExeDesktop ShortcutView System WindowsOptions

    RunRun NowRecordStop

    HelpContentsCheck for UpdateSupport ForumsAbout

    31

    31

    31

    31

    32

    32

    32

    32

    32

    32

    32

    33

    33

    33

    33

    34

    34

    34

    34

    34

    34

    36

    34

    36

    36

    37

    38

    38

    38

    38

    38

    38

    39

  • 4Using Macro Scheduler

    2014 MJT Net Ltd

    1.3 Toolbar

    The top row of the toolbar contains the menu and buttons to Run , Stop and Recordmacros.

    Buttons from Left to Right on the second line are:

    New Macro , Macro Properties , Delete Macro , New Group , Delete Group , GroupProperties , View LogFile , Desktop Shortcut , Create Exe , Help

    1.4 Creating Scripts

    To create a new script select 'File/New Macro', or click the 'New' button on the Toolbar . To Editan existing script, select it from the list by clicking on it and then select 'File/Macro Properties' ordouble click on it. Having done this you will be presented with the following window:

    38 38 38

    31 31 32 32 33

    33 36 36 34 38

    4

  • 5 Macro Scheduler

    2014 MJT Net Ltd

    In this example an existing script was selected to be edited. If 'New' had been pressed then this formwould appear blank.

    Code can be inserted and edited directly into the script editor. Use the Code Builders andWizards found in the left hand Code Builders pane to help locate functions and insert code.

    Pressing F1 in the editor will present the help topic for the highlighted function or, if no text ishighlighted, the function in the current line. To test the script click the 'Run' button. Note that whenrunning a script from within the editor you are actually running in debug mode. If you have a log fileenabled it will not be updated while running in debug mode.

    To save the macro press the Save toolbar button. If you have not yet given the macro a name youwill be asked for one. Press Save to save any changes made to the macro script or properties.

    Save As will allow you to save to a new macro or script file and context will then change to thatscript/macro. In contrast Export will simply save a copy of the script file but you will continueworking on the current macro.

    The script editor provides a full featured programmer's editor with code folding, bookmarks, the Debugger and other script building options including the Dialog Designer and Code Snippets. See also Code Folding and Bookmarks . You can also set the script backup options from theeditor's tools menu.

    10

    10

    22 24

    12 6

  • 6Using Macro Scheduler

    2014 MJT Net Ltd

    The Import button allows you to load in a script that has already been created. This is useful if youhave a number of Macro Scheduler installations and want to make use of a script created on adifferent PC for example.

    The numbers at the top right of this window show your mouse cursor position. Use these todetermine the correct parameters when using the MouseMove command. The button to the left ofthe numbers reveals a drop down menu which allows you to toggle between absolute coordinatesand relative coordinates. When set to relative, the numbers show you the relative coordinates to thewindow the cursor moves over. The other option allows you to attach a small tag to the mousecursor that shows the coordinates and follows the cursor around. This means that if the scriptwindow becomes concealed by another application you can still see the cursor position. If you thenpress both left and right mouse buttons the content of the cursor monitor window will be copied tothe clipboard, making it easy