'Created By:
'Date Created: NOVEMBER 04, 2015
'Date Revised: NOVEMBER 04, 2015
'Title: MOD_GRAB_SCREEN
'Reading File from C:\Users\Username\Documents\AHK\Batch_Manipulator\GrabScreenFile.txt
Sub GrabScreen()
Dim hostSettleTimeout As Integer
Dim hostSettleTime As Integer
Dim osCurrentScreen As Screen
Dim osCurrentTerminal As Terminal
Dim returnValue As Integer
Dim hiddenTextEntry As String
hostSettleTimeout = 5000
hostSettleTime = 300
Set osCurrentTerminal = ThisFrame.SelectedView.control
Set osCurrentScreen = osCurrentTerminal.Screen
' ******** This is for Grabbing the Screen Lease Contract Maintenance/Inquiry.*************************
' Select and copy text from the screen
Call Wait_75
osCurrentScreen.SelectText 1, 1, 24, 80, RegionOption_Wrapped
Call Wait_75
' Press EditCopy (Copy the selection and put it on the Clipboard).
osCurrentScreen.Copy
Call Wait_75
For x = 1 To 3
' osCurrentScreen.SelectText 1, 1, 1, 2, RegionOption_Wrapped
Call Wait_75
Next x
' ******** This is for Placing the Grabbed Information to Clipboard.*************************
' Clipboard to Variable strClip
Dim MyData As DataObject
Dim strClip As String
Set MyData = New DataObject
MyData.GetFromClipboard
strClip = MyData.GetText
Dim myUser2 As String
myUser2 = Environ("username")
MyFile = "C:\Users\" & myUser2 & "\Documents\AHK\Batch_Manipulator\GrabScreenFile.txt"
' ******** This is for MODULE_GrabScreen.*************************
' Writing to File C:\Users\Username\Documents\AHK\Batch_Manipulator\GrabScreenFile.txt
Set fs = CreateObject("Scripting.FileSystemObject")
Set A = fs.CreateTextFile("C:\Users\" & myUser2 & "\Documents\AHK\Batch_Manipulator\GrabScreenFile.txt", True)
A.WriteLine (strClip)
A.Close
' ******** This is for AHK GrabScreen.*************************
' Run Executable C:\Users\" & myUser2 & "\Documents\AHK\Batch_Manipulator\GrabScreen.exe
Call Wait_75
Dim RetVal
RetVal = Shell("C:\Users\" & myUser2 & "\Documents\AHK\Batch_Manipulator\GrabScreen.exe", 1) ' Run GrabScreen.exe.
Call Wait_75
End Sub