-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathSplitting_a_TextScapple.ahk
51 lines (40 loc) · 1.12 KB
/
Splitting_a_TextScapple.ahk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
#SingleInstance, Force
;***splitting a text into multiple setences SCAPPLE***
^!Tab:: ;press Ctrl+Alt+Tab
Clipback := ClipboardAll
Clipboard =
send, ^c
Sleep, 200
ClipWait,1
if ErrorLevel{
Clipboard:=Clipback
MsgBox, No text was sent to clipboard
return
}
StringReplace, Clipboard , Clipboard , `r`n, %A_Space%, All
separate := RegExReplace(Clipboard,"((?<!\w\.\w.)(?<![A-Z][a-z]\.)(?<=\.|\?)\s)","@@@`n")
If WinExist("ahk_exe Scapple.exe")
{
WinActivate, ahk_exe Scapple.exe
WinWaitActive, ahk_exe Scapple.exe
}
else
{
Run, D:\program file\scapple.exe
WinActivate
WinWaitActive, ahk_exe Scapple.exe
}
for i, row in StrSplit(separate,"@@@`n"){
data.= row
Clipboard:=data
Send ^{Enter}
send, ^v
Sleep, 150
Clipboard := Clipback
data:=""
}
return