【发布时间】:2018-08-13 05:33:07
【问题描述】:
我在使用 ControlSend 时遇到问题。当我尝试向记事本发送文本但 ControlSend 禁止换行时。 例如 它向记事本发送以下内容:
> <p style="font-size:50px;font-weight:900"></p>
而不是这个:
> ++++
> <p style="font-size:50px;font-weight:900"></p>
> ++++
我的代码(抱歉设计不佳):
append()
{ControlSend,Edit1,Clipboard,ahk_exe notepad.exe} ;Problem here
#If GetKeyState("Ctrl") && GetKeyState("Shift")
{
e & h::
Title:= ""
InputBox, OutputVar ,"Title Level"
InputBox, HeadingName ,"Title Name"
if(OutputVar = 7)
{
Clipboard := "`n" . "++++" . "`n" . "<p style=""font-size:55px;font-weight:900"">" . HeadingName . "</p>" . "`n" . "++++" . "`n"
sleep 30
}
else if(OutputVar = 8)
{
Clipboard :="`n" . "++++" . "`n" . "<p style=""font-size:50px;font-weight:900"">++++" . HeadingName . "</p>" . "`n" . "++++" . "`n"
}
else if(OutputVar = 9)
{
Clipboard := "`n" . "++++" . "`n" . "<p style=""font-size:45px;font-weight:900"">" . HeadingName . "</p>" . "`n" . "++++" . "`n"
}
else if(OutputVar = 10)
{
Clipboard := "`n" . "++++" . "`n" . "<p style=""font-size:35px;font-weight:900"">" . HeadingName . "</p>" . "`n" . "++++" . "`n"
Sleep 30
}
else if(OutputVar = 11)
{
Clipboard := "`n" . "++++" . "`n" . "<p style=""font-size:30px;font-weight:900"">" . HeadingName . "</p>" . "`n" . "++++" . "`n"
}
else if(OutputVar = 12)
{
Clipboard := "`n" . "++++" . "`n" . "<p style=""font-size:25px;font-weight:900"">" . HeadingName . "</p>" . "`n" . "++++" . "`n"
}
sleep 30
append()
sleep 30
Return
;/...
}
我在剪贴板中也有额外的换行问题 例如:
它发送这个:
> [source]
> ----
> x
>
> y
>
> z
> ----
而不是这个:
> [source]
> ----
> x
> y
> z
> ----
【问题讨论】:
标签: autohotkey