Jump to content
Sign in to follow this  
jerrbert

Error: missing EndIf

Recommended Posts

jerrbert

I've come across an error that I haven't been able to find a solution to. Any help you can give would be great.

I am posting the entire .au3, but it is called from another file. I split them up thinking it would be easier to navigate, make changes, and make additions. The entire script is meant to automate testing in an EMR application the hospital I work for uses. That way, any analyst can run the testing script, even though they may not be familiar with the section of the application being tested.

When I try and run the script, it opens this .au3 and gives me a "Error: missing EndIf" error.

The error is placed at the beginning of the function at the bottom of the script.

I can't find an if statement that hasn't been closed.

#include-once
#include <File.au3>

Local $vCPActive, $vCP2Active, $vCP1

AutoItSetOption("SendKeyDelay", 300) ;300 milliseconds

ToolTip("Checking Clinician Portal", 400, 300)
Sleep(2000)
ToolTip("")
_FileWriteLog($vLog, "Checking Clinician Portal")
Run("C:\Program Files\Internet Explorer\iexplore.exe")
Sleep(4000)
MsgBox(0, "HERO", "Click OK after Internet Explorer opens and finishes loading.")
Sleep(500)
$vCPActive = WinGetTitle("Intranet Homepage")
If StringInStr($vCPActive, "Intranet Homepage") Then
If $msg = $vDEVRadio Then
     _ClinicianPortal("devweb2")
ElseIf $msg = $vTESTRadio Then
     _ClinicianPortal("scmwebt1")
ElseIf $msg = $vPRODRadio Then
     _ClinicianPortal("scmweb2")
ElseIf $msg = $vTRAINRadio Then
     _FileWriteLog($vLog, "Training Environment selected - there is no Clinician Portal in TRAIN.")
EndIf
Else
_FileWriteLog($vLog, "Error: Internet Explorer did not open")
EndIf
Sleep(2000)
Send("!fx")
Sleep(1000)

; #FUNCTION# ====================================================================================================================
; Name ..........: _ClinicianPortal
; Description ...:
; Syntax ........: _ClinicianPortal($vWebServer)
; Parameters ....: $vWebServer       - What webserver is Clinician Portal on?
; Return values .: None
; Author ........: Jerry Erickson
; Modified ......:
; Remarks .......:
; Related .......:
; Link ..........:
; Example .......: No
; ===============================================================================================================================
Func _ClinicianPortal($vWebServer)
Send("{TAB}http://" & $vWebServer & "/scp{ENTER}")
Sleep(4000)
MsgBox(0, "HERO", "Click OK after Clinician Portal page finishes loading.")
Sleep(500)
$vCP2Active = WinGetTitle("Sunrise Clinician Portal")
If StringInStr($vCP2Active, "Sunrise Clinician Portal") Then
Send($myUserName)
Send("{TAB}")
Send($myPassword)
Send("{ENTER}")
Sleep(5000)
$vCP1 = MsgBox(36, "HERO", "Did Clinician Portal open?")
If $vCP1 = 6 Then
     _FileWriteLog($vLog, "Clinician Portal = Success")
ElseIf $vCP1 = 7 Then
     _FileWriteLog($vLog, "Clinician Portal = Failure")
EndIf
While WinActivate("HERO") = 0
     WinActivate("HERO")
WEnd
Else
_FileWriteLog($vLog, "Clinician Portal did not open.")
EndIf
EndFunc ;==>_ClinicianPortal

Share this post


Link to post
Share on other sites
guinness

I got a lot of error messages, for obvious reasons. Run in SciTE (SciTE4AutoIt3) and the error will appear in the console output.

As you're new welcome to the Forum. If you haven't already may I direct your attention to the Forum rules, just in case you decide to post in the future. Thanks and welcome to the wonderful Forum.

Edited by guinness

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Share this post


Link to post
Share on other sites
czardas

I seems okay after declaring all undeclared variables included in the snippet.

Share this post


Link to post
Share on other sites
jerrbert

I should have added this to the original post, there are variables in this script that are declared by the script that calls this one.

$vLog

$msg

$vDEVRadio

$vTESTRadio

$vPRODRadio

$vTRAINRadio

$myUserName

$myPassword

Share this post


Link to post
Share on other sites
czardas

After which no error message appears for me. So the error may be elsewhere in the code you didn't post.

Edited by czardas

Share this post


Link to post
Share on other sites
water

I couldn't find an error in the posted code (except hte missing $vLog variable as stated by czards).

I had scripts where Tidy (Ctrl+t) perfectly showed the location of the error.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
guinness

I reckon there is code missing.


UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Share this post


Link to post
Share on other sites
water

As stated in the OP: "I am posting the entire .au3, but it is called from another file."

Without seeing both scripts it is impossible to find the error.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
jerrbert

It may help to post the code that calls this file. Here it is.

Guiness, thanks. I did look at the rules.

Water, I used Tidy before posting and it showed nothing wrong with the script.

#region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Res_requestedExecutionLevel=asInvoker
#endregion ;**** Directives created by AutoIt3Wrapper_GUI ****
#NoTrayIcon
#include-once
#include <File.au3>
#include <Date.au3>
AutoItSetOption("MouseCoordMode", 0)
AutoItSetOption("SendKeyDelay", 300) ;300 milliseconds
Global $vPause
Local $vPLH1, $vTAB1, $vExcelActive, $vTAB7, $vCDV1, $vTAB9, $vOTF1, $vOTF2, $vOTF3
Local $vBI1, $vBI2, $vBI3, $vBI4, $vBI5, $vAPP1, $vAPP2, $vLCF1, $vTV2Active, $vMAR1, $vWindows, $vLog
Local $msg2, $vLabel1, $vLabel2, $vLabel3, $vLabel4, $vBody, $vButton1, $vLabel5, $vLabel6, $vTAB4, $vHelpRActive, $vRH1
Local $msg, $vDEVRadio, $vTESTRadio, $vTRAINRadio, $vPRODRadio, $vEnv, $vTAB3, $vHelpOActive, $vOH1
Local $vVS1, $vVS2, $vVS3, $vHW1, $vVS4, $vVSActive, $vVS5, $vVS2Active, $vVS6, $vAAI1, $vAAI2, $vHelpFSActive, $vFSH1
Local $vTAB2, $vCS1, $vHelpCSActive, $vCSH1, $vTAB5, $vHelpDActive, $vDH1, $vTAB6, $vHelpPIActive, $vPIH1
Local $vTAB8, $vSRM1, $vSRMLast, $vSRMFirst, $vSRM3, $vSRM2, $vIcon4, $veSCRActive, $vIcon5, $vPACSActive
Local $vOMRActive, $vOMR1, $vOMR3Active, $vOMR2, $vOMR4Active, $vIcon2, $vIcon3
Local $vRXActive, $vRX1, $vRX2Active, $vRX3Active, $vRX2, $vRX4Active, $vIcon1
Local $vPrintActive, $vPrint2Active, $vPrint3Active, $vPrint1, $vPrintActive2, $vPrint2
Local $vExitActive, $vExit1, $vExit2, $vExit3, $vCPActive, $vCP2Active, $vCP1, $vTV2Active
Local $msg3, $vLabel7, $vLabel8, $vLabel2, $vLabel9, $vCheck1, $vCheck2, $vCheck3, $vCheck4, $vCheck5, $vCheck6, $vCheck7, $vCheck8, $vCheck9
Local $vCheck10, $vCheck11, $vCheck12, $vCheck13, $vCheck14, $vCheck15, $vCheck16, $vCheck17, $vCheck18, $vCheck19, $vCheck20, $vButton2
Local $vCitrix1Radio, $vCitrix2Radio, $vCitrix3Radio, $vCitrix4Radio, $vCitrix5Radio, $vCitrix6Radio, $vCitrix7Radio, $vCitrix8Radio, $vCitrix9Radio
Local $vCitrix10Radio, $vCitrix11Radio, $vCitrix12Radio, $vCitrix13Radio, $vCitrix14Radio, $vCitrix20Radio, $vCitrix21Radio, $vCitrix22Radio, $vCitrix23Radio
Local $vCitrix24Radio, $vCitrix25Radio, $vCitrix26Radio

HotKeySet("{PAUSE}", "TogglePause")
HotKeySet("{ESC}", "Terminate")
Local $zDate = @MON & "." & @MDAY & "." & @YEAR & "-" & @HOUR & "." & @MIN & "." & @SEC
$vLog = "C:\HEROTest" & $zDate & ".log"
_FileWriteLog($vLog, "***************************************************************************")
_FileWriteLog($vLog, "HERO Test Script Log File")
_FileWriteLog($vLog, "Created by:  Jerry Erickson/Steve Dixon")
_FileWriteLog($vLog, "Created on:  6/1/2012")
_FileWriteLog($vLog, "Change Log:")
_FileWriteLog($vLog, "- Added Welcome Page  6/21/2012  -je")
_FileWriteLog($vLog, "- Changed Structure (v2)  6/22/2012  -je")
_FileWriteLog($vLog, "- Added Windows version question  6/26/2012  -je")
_FileWriteLog($vLog, "- Changed way log file is written  6/29/2012  -je")
_FileWriteLog($vLog, "- Changed Opening.au3 to always open Citrix through run menu  8/30/2012  -je")
_FileWriteLog($vLog, "- Changed Opening.au3: added GUI for specific PROD Citrix Servers  8/30/2012  -je")
_FileWriteLog($vLog, "***************************************************************************")
_FileWriteLog($vLog, "")
_FileWriteLog($vLog, "")
#include "Opening.au3"
WinWaitActive("Allscripts Gateway Logon")
_FileWriteLog($vLog, "Logging into HERO")
;Input Username and Password
ToolTip("Login", 400, 300)
Sleep(2000)
ToolTip("")
_FileWriteLog($vLog, "Determining SSO")
Local $vLogon = MsgBox(36, "SSO", "Do you use SSO?")
If $vLogon = 7 Then
 Sleep(1000)
 Local $myUserName = InputBox("Username", "Please enter HERO username:")
 WinActivate("Username")
 While $myUserName = ""
  _FileWriteLog($vLog, "Error:  No username entered")
  MsgBox(16, "Error", "You have to enter a UserName to continue.")
  Local $myUserName = InputBox("Username", "Please enter HERO username:")
  WinActivate("Username")
 WEnd
 _FileWriteLog($vLog, "User logging in as " & $myUserName)
 Local $myPassword = InputBox("Password", "Please enter password:", "", "*")
 WinActivate("Password")
 While $myPassword = ""
  _FileWriteLog($vLog, "Error:  No password entered")
  MsgBox(16, "Error", "You have to enter a Password to continue.")
  Local $myPassword = InputBox("Password", "Please enter password:", "", "*")
  WinActivate("Password")
 WEnd
 Sleep(2000)
 ;WinActivate("Allscripts Gateway Logon")
 While WinActive("Allscripts Gateway Logon") = 0
  WinActivate("Allscripts Gateway Logon")
 WEnd
 Sleep(1000)
 ;Logon to Application
 Send($myUserName)
 Send("{TAB}")
 Send($myPassword)
 Send("{ENTER}")
EndIf
WinWaitActive("Allscripts Gateway | My Applications")
_FileWriteLog($vLog, "HERO open")
Sleep(3000)
;Ask user to select Acute Care
SplashTextOn("Select Application", "If Acute Care is not open, please open it.", 250, 120, -1, -1, 0, "", 12, 600)
Sleep(5000)
SplashOff()
;Close the Sidebar
MsgBox(16, "IMPORTANT!", "Close the sidebar.  Click OK AFTER sidebar is closed.")
;Notify Script when Acute Care has launched.
MsgBox(16, "WAIT!", "Click OK only after Actue Care has finished launching.")
;Open Find Patient window
_FileWriteLog($vLog, "Searching for patient")
;WinActivate("Allscripts Gateway | My Applications")
While WinActive("Allscripts Gateway | My Applications") = 0
 WinActivate("Allscripts Gateway | My Applications")
WEnd
Sleep(1000)
Send("{TAB 4}")
Send("f")
Send("f")
MsgBox(16, "WAIT!", "Click OK after Find Patient window opens." & @CRLF & @CRLF & "If the Find Patient window doesn't open after a few seconds, please open it.")
Sleep(500)
;WinWaitActive("Find Patient - [url="file://\Remote"]\\Remote[/url]")
ToolTip("Finding Patient", 400, 300)
Sleep(2000)
ToolTip("")
Local $vFPActive = WinGetTitle("Find Patient")
If StringInStr($vFPActive, "Find Patient") Then
 ;Search for Patient
 Local $vLast = InputBox("Patient Last Name", "Please input the test patient's last name:")
 WinActivate("Patient Last Name")
 While $vLast = ""
  _FileWriteLog($vLog, "Error:  No patient last name entered")
  MsgBox(16, "Error", "You have to enter a last name for the test patient to continue.")
  Local $vLast = InputBox("Patient Last Name", "Please input the test patient's last name:")
  WinActivate("Patient Last Name")
 WEnd
 Local $vFirst = InputBox("Patient First Name", "Please input the test patient's first name:")
 WinActivate("Patient First Name")
 While $vFirst = ""
  _FileWriteLog($vLog, "Error:  No patient first name entered")
  MsgBox(16, "Error", "You have to enter a first name for the test patient to continue.")
  Local $vFirst = InputBox("Patient First Name", "Please input the test patient's first name:")
  WinActivate("Patient First Name")
 WEnd
 _FileWriteLog($vLog, "Patient name used for testing is " & $vLast & ", " & $vFirst)
 ;WinActivate("Find Patient - [url="file://\Remote"]\\Remote[/url]")
 While WinActive("Find Patient - [url="file://\Remote"]\\Remote[/url]") = 0
  WinActivate("Find Patient - [url="file://\Remote"]\\Remote[/url]")
 WEnd
 Sleep(1000)
 Send("{TAB 3}")
 Send($vLast)
 Send("{TAB}")
 Send($vFirst)
 Send("{ENTER}")
 Sleep(2000)
 Local $vActive = WinGetTitle("Sun")
 While $vActive = "SunriseXA - [url="file://\Remote"]\\Remote[/url]"
  _FileWriteLog($vLog, "Patient name not found.")
  While WinActive("SunriseXA - [url="file://\Remote"]\\Remote[/url]") = 0
   WinActivate("SunriseXA - [url="file://\Remote"]\\Remote[/url]")
  WEnd
  Send("{ENTER}")
  SplashTextOn("Error", "Patient name not found." & @CRLF & @CRLF & "Please try again.", 250, 120, -1, -1, 0, "", 12, 600)
  Sleep(5000)
  SplashOff()
  WinWaitActive("Find Patient - [url="file://\Remote"]\\Remote[/url]")
  Local $vLast = InputBox("Patient Last Name", "Please input the test patient's last name:")
  While WinActive("Patient Last Name") = 0
   WinActivate("Patient Last Name")
  WEnd
  While $vLast = ""
   _FileWriteLog($vLog, "Error:  No patient last name entered.  (attempt after patient error)")
   SplashTextOn("Error", "You have to enter a last name for the test patient to continue.", 250, 120, -1, -1, 0, "", 12, 600)
   Sleep(5000)
   SplashOff()
   Local $vLast = InputBox("Patient Last Name", "Please input the test patient's last name:")
   While WinActive("Patient Last Name") = 0
    WinActivate("Patient Last Name")
   WEnd
  WEnd
  Local $vFirst = InputBox("Patient First Name", "Please input the test patient's first name:")
  While WinActive("Patient First Name") = 0
   WinActivate("Patient First Name")
  WEnd
  While $vFirst = ""
   _FileWriteLog($vLog, "Error:  No patient first name entered.  (attempt after patient error)")
   SplashTextOn("Error", "You have to enter a first name for the test patient to continue.", 250, 120, -1, -1, 0, "", 12, 600)
   Sleep(5000)
   SplashOff()
   Local $vFirst = InputBox("Patient First Name", "Please input the test patient's first name:")
   While WinActive("Patient First Name") = 0
    WinActivate("Patient First Name")
   WEnd
  WEnd
  _FileWriteLog($vLog, "Patient name used for testing is " & $vLast & ", " & $vFirst & "(attempt after patient error)")
  While WinActive("Find Patient - [url="file://\Remote"]\\Remote[/url]") = 0
   WinActivate("Find Patient - [url="file://\Remote"]\\Remote[/url]")
  WEnd
  Sleep(1000)
  Send("+{TAB}")
  Send($vLast)
  Send("{TAB}")
  Send($vFirst)
  Send("{ENTER}")
  If WinGetTitle("Sun") = "SunriseXA - [url="file://\Remote"]\\Remote[/url]" Then
   $vActive = "SunriseXA - [url="file://\Remote"]\\Remote[/url]"
  Else
   $vActive = ""
  EndIf
 WEnd
 Sleep(4000)
 Send("{TAB 12}{SPACE}{TAB}{ENTER}")
 Send("{TAB}{SPACE}{TAB 2}{ENTER}")
 Sleep(5000)
Else
 _FileWriteLog($vLog, "Error: Find Patient window failed to open.  Script will exit.")
 MsgBox(16, "ERROR", "Find Patient window failed to open.  Run script again.")
 Exit
EndIf
Sleep(4000)
ToolTip("Checking Patient List Help File", 400, 300)
Sleep(4000)
ToolTip("")
_FileWriteLog($vLog, "Checking Patient List Help icon")
While WinActive("Allscripts Gateway | My Applications") = 0
 WinActivate("Allscripts Gateway | My Applications")
WEnd
Send("!f")
Send("{f1}")
Sleep(4000)
WinActivate("Allscripts Gateway Help")
Local $vHelpPLActive = WinGetTitle("Allscripts Gateway Help")
If StringInStr($vHelpPLActive, "Allscripts Gateway Help") Then
 Local $vPLH1 = MsgBox(36, "Patient List Help", "Did the Help window for Patient Lists open?")
 If $vPLH1 = 6 Then
  _FileWriteLog($vLog, "Patient List Help = Success")
  WinClose("Allscripts Gateway Help")
 EndIf
Else
 _FileWriteLog($vLog, "Patient List Help = Failure")
 $vPLH1 = 7
EndIf
;Structured Notes
If $vCheck1 = "Yes" Then
 #include "Structured.au3"
EndIf
;Flowsheets
If $vCheck2 = "Yes" Then
 #include "Flowsheets.au3"
EndIf
;Tabs
If $vCheck3 = "Yes" Then
 _FileWriteLog($vLog, "Checking Tabs")
 #include "Tabs.au3"
EndIf
;Clinical Summary Tab
If $vCheck4 = "Yes" Then
 #include "ClinicalSummary.au3"
EndIf
;Orders Tab
If $vCheck5 = "Yes" Then
 #include "Orders.au3"
EndIf
;Results Tab
If $vCheck6 = "Yes" Then
 #include "Results.au3"
EndIf
;Documents Tab
If $vCheck7 = "Yes" Then
 #include "Documents.au3"
EndIf
;Patient Info Tab
If $vCheck8 = "Yes" Then
 #include "PatientInfo.au3"
EndIf
;Clinical Data Viewer
If $vCheck9 = "Yes" Then
 #include "CDV.au3"
EndIf
;Records Management Tab
If $vCheck10 = "Yes" Then
 #include "SRM.au3"
EndIf
;HIE Tab
If $vCheck11 = "Yes" Then
 #include "HIE.au3"
EndIf
;Orders-To-Flowsheet
If $vCheck12 = "Yes" Then
 #include "OTF.au3"
EndIf
;Verify Pneum Order
If $vCheck1 = "Yes" Then
 #include "Verify.au3"
EndIf
;eMAR
If $vCheck13 = "Yes" Then
 #include "EMAR.au3"
EndIf
;Outpatient Medication Review
If $vCheck14 = "Yes" Then
 #include "OMR.au3"
EndIf
;Rx Writer
If $vCheck15 = "Yes" Then
 #include "RxWriter.au3"
EndIf
;Printing
If $vCheck16 = "Yes" Then
 #include "Printing.au3"
EndIf
;ExitCare
If $vCheck17 = "Yes" Then
 #include "ExitCare.au3"
EndIf
;Clinician Portal
If $vCheck18 = "Yes" Then
 #include "ClinicianPortal.au3"
EndIf
;Icons
If $vCheck19 = "Yes" Then
 #include "Icons.au3"
EndIf
;Excel Report
Sleep(3000)
SplashTextOn("HERO", "Close Gateway", 250, 180, -1, -1, 0, "", 12, 600)
Sleep(4000)
SplashOff()
MsgBox(0, "HERO", "Click OK after the Gateway is closed.")
Sleep(500)
If $vCheck20 = "Yes" Then
 #include "ExcelReport.au3"
EndIf
_FileWriteLog($vLog, "Testing Script complete.  Exiting.")
;Functions
Func TogglePause()
 $vPause = Not $vPause
 While $vPause
  Sleep(100)
  ToolTip('Script is "Paused"', 500, 500, "Pause", 1, 6)
 WEnd
 ToolTip("")
 _FileWriteLog($vLog, "Script paused/unpaused by user.")
EndFunc   ;==>TogglePause
Func Terminate()
 _FileWriteLog($vLog, "Script exited by user.")
 Exit 0
EndFunc   ;==>Terminate

Share this post


Link to post
Share on other sites
guinness

I don't know why the OP doesn't just read the output in the bottom? I've sometimes forgot to append EndIf, but voila Au3Check reports the location of the error in less than a second.


UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Share this post


Link to post
Share on other sites
water

This code doesn't work as you expect. You can't conditionally include other files!

If $vCheck15 = "Yes" Then
    #include "RxWriter.au3"
EndIf

I suggest do place all #include statements at the top of your script and remove the If /Then code.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
jerrbert

Water, fair enough. It seemed right when I wrote it. LOL

I will bring everything back together into one script and test again to see if the issue is still there.

Thanks, all!

Share this post


Link to post
Share on other sites
water

Glad to be of service :D


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
guinness

Perhaps I'm not following? If I have an error in an include it will display in SciTE.


UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Share this post


Link to post
Share on other sites
water

Let the user remove the obvious bugs he has in his script (conditional include). If the error persists it is then easier to locate as he merges the two scripts back into a single file.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
jerrbert

I merged everything back into a single script and was able to run the script with no issues. I need to begin doing the testing to make sure it's functional and does what the users want, but that's nothing I need help with here. :)

Thanks, again.

Share this post


Link to post
Share on other sites
water

To make your script more reliable I would suggest to replace the Send commands with ControlSend etc. Send only works with the active window so user interaction could become a problem.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
guinness

OK, but for the record conditional includes don't cause errors and nor do they exclude the UDF from being included. That's what a pre-processor is defined for.


UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Share this post


Link to post
Share on other sites
water

No one said that the conditional includes caused the error.

The OP just tried to split a large script into smaller chunks. It looks like he then introduced an error.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×