The only issue was that it would only run manually.
Code: Select all
#b::
SendMode Input ; The following works a lot better with Send's Input mode
$+Right::
Send, {shift down}{right}{ctrl down}{c}{ctrl up}{shift up} ; Move the cursor right and copy the current selection to the clipboard
Sleep, 25 ; Give the system time to update the clipboard
StringRight, lastchar, clipboard, 1 ; Store the last character of the selection to variable lastchar
If lastchar = / ; If the last character is a /
Send, {shift down}{left}{ctrl down}{c}{ctrl up}{shift up} ; Move the cursor left (so that the / isn't included) and copy the current selection to the clipboard
Return
Code: Select all
#b::
SendMode Input
$+Right::
Send, +{right}^c
Sleep, 25
StringRight, lastchar, clipboard, 1
If lastchar = /
Send, +{End}^c
Return
So then I put in an IF statement but it doesn't work
Code: Select all
#b::
StringRight, lastchar, clipboard, 1
If lastchar != /
{
Send, +{right}^c
Sleep 10
GoSub #b
}
else
{
Sleep 10
Send, {Left}{Del}+{End}^x{enter}^v{Home}
}
Return