Hitting a wall here. I have the below script which I use as a bit of a notepad etc. What I am trying to add is the option of removing multiple lines.
Etc I copy an email below. What I am wanting to do is remove anything that has additional spacing. Eg multiple %CRLF%'s & double %SPACE%'s. So if there is more than 2x CRLF's make it one & if there are issues like this where there is the double spaces it removes it. I have played around with String Replace, but haven't had much success. Any other ideas / suggestions.
Code: Select all
From: XXX
Sent: Friday, 6 June 2014 3:20 PM
To: XXX
Subject: Request INC-XXXReassigned From XXX
Service Desk: Request Reassigned
Dear XXX,
Reference No: XXX
Description: URGENT - Follow You Printing (XXX)
This request has been assigned to you by Marval user XXX with the following information:
on review, it appears that XXX did not receive the ICT advisory for XXX on L02 XXX House.
Have found that XXX is not on the DL for L02 XXX House.
While on site, assisted client with registering for XXX.
Spoke to XXX to report the DL issue.
messaging XXX with a follow up with links for Follow-You.
Nothing further to action at this time.
solving pending further issues.
Code: Select all
// COMPILE_OPTS|C:\_tools\MJ\Text Capture.exe|M:\Icons\fonts.ico|CONSOLE=0|INCLUDES=1| /LOGFILE=\dev\nul /NOSYSTRAY /HIDE|RUNTIMES=1|BMPS=1
Let>APP_TITLE=Text Capture
Let>MSG_HEIGHT=320
Let>MSG_WIDTH=500
Let>MSG_STAYONTOP=1
Let>MSG_CENTERED=1
Dialog>Dialog1
object Dialog1: TForm
Left = 247
Top = 96
HelpContext = 5000
BorderIcons = [biSystemMenu, biMinimize]
BorderStyle = bsSingle
Caption = 'CustomDialog'
ClientHeight = 278
ClientWidth = 624
Color = clBtnFace
Font.Charset = ANSI_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Courier New'
Font.Style = []
OldCreateOrder = True
Position = poDefault
ShowHint = False
OnTaskBar = True
PixelsPerInch = 96
TextHeight = 14
object Label1: TLabel
Left = 8
Top = 8
Width = 84
Height = 14
Caption = 'Text Capture'
end
object MSMemo1: tMSMemo
Left = 8
Top = 24
Width = 609
Height = 201
WantTabs = True
WordWrap = True
ScrollBars = ssVertical
ScrollBarsAutoShowing = ssVertical
TabOrder = 0
end
object MSButton1: tMSButton
Left = 8
Top = 232
Width = 153
Height = 41
Caption = 'Save 2 Clipboard'#13#10'With Date / Time'
TabOrder = 1
DoBrowse = False
BrowseStyle = fbOpen
end
object MSButton2: tMSButton
Left = 168
Top = 232
Width = 153
Height = 41
Caption = 'Save 2 Clipboard'#13#10'Without Date / Time'
TabOrder = 2
DoBrowse = False
BrowseStyle = fbOpen
end
object MSButton3: tMSButton
Left = 328
Top = 232
Width = 153
Height = 41
Caption = 'Get From'#13#10'Clipboard'
TabOrder = 3
DoBrowse = False
BrowseStyle = fbOpen
end
object MSButton4: tMSButton
Left = 552
Top = 232
Width = 65
Height = 41
Caption = 'Clear'
TabOrder = 4
DoBrowse = False
BrowseStyle = fbOpen
end
end
EndDialog>Dialog1
AddDialogHandler>Dialog1,MSButton1,OnClick,Put1
AddDialogHandler>Dialog1,MSButton2,OnClick,Put2
AddDialogHandler>Dialog1,MSButton3,OnClick,Get
AddDialogHandler>Dialog1,MSButton4,OnClick,Clear
SetDialogProperty>Dialog1,,Caption,%APP_TITLE%
SetDialogProperty>Dialog1,,OnTaskBar,True
SetDialogProperty>Dialog1,Label1,Caption,%APP_TITLE%
GetScreenRes>Width,Height
SetDialogProperty>Dialog1,,Top,10
SetDialogProperty>Dialog1,,Width,640
Let>Width=%Width%-640
SetDialogProperty>Dialog1,,Left,%Width%
Show>Dialog1,Dialog1Result
If>Dialog1Result=2,Exit
SRT>Put1
GetDialogProperty>Dialog1,MSMemo1,Text,MemoBox
Day>TheDay
Month>TheMonth
Year>TheYear
Hour>TheHour
Min>TheMin
Let>SEP=------------------------------
PutClipBoard>Date: %TheDay%/%TheMonth%/%TheYear% - Time: %TheHour%:%TheMin%%CRLF%%SEP%%CRLF%%MemoBox%%CRLF%%SEP%%CRLF%User ID: %USER_NAME%
END>Put1
SRT>Put2
GetDialogProperty>Dialog1,MSMemo1,Text,MemoBox
PutClipBoard>%MemoBox%
END>Put2
SRT>Get
GetClipBoard>FromClipBoard
SetDialogProperty>Dialog1,MSMemo1,Text,%FromClipBoard%
END>Get
SRT>Clear
SetDialogProperty>Dialog1,MSMemo1,Text,
Ask>Do You Want To Clear The Clipboard As Well?,AskResult
If>AskResult=YES
PutClipBoard>
EndIf
END>Clear
Label>Exit