PlainText 1.10

PlainPaste 方便您粘贴不带格式的纯文本。安装后,您可使用 CTRL+C 复制文,然后按下 CTRL+SHIFT+V 在另一个应用中粘贴不带格式的文本。

这在您希望将网页的内容粘贴到您的程序中时尤其有用,例如将页面表格中的内容粘贴到 Excel 中。

如何使用:

选中文字,按下 CTRL+C 或运行右键上的“复制”命令,在任何基于文本的程序中(如 Microsoft Word) 按下 CTRL+SHIFT+V 粘贴不带格式的文本。

您也可以先点一下系统托盘中的图标,然后使用常规的 CTRL+V 粘贴命令来粘贴纯文本。

PlainPaste.exe 是一个仅有 77K 大小的可执行程序。运行后系统托盘中会多一个绿色的箭头

PlainText 为免费软件。其功能也被添加到了 Google Translate for Translators 中,GT4T 将谷歌翻译无缝集成到了 Trados、Word 及所有基于文本的应用中。如果您安装了 GT4T,则不再需要安装 PlainText。

PlainText 由 autohotkey 开发:

#Persistent
#SingleInstance force
SetBatchLines, -1
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.

DblClickSpeed := DllCall("GetDoubleClickTime") , firstClick := 0
;menu
;http://www.autohotkey.com/forum/topic54947.html

iniread,LoadonStartup,Hotkeys.ini,Options,LoadonStartup
if LoadonStartup=1
regwrite,REG_SZ,HKEY_LOCAL_MACHINE,software\microsoft\windows\currentversion\run, PlainText,%A_ScriptDir%\plaintext.exe

Menu,Tray, Tip, Plaintext 1.10
Menu, Tray, Add,Convert to plain text, ClickHandler
Menu, Tray, Add,Hot Key, Hots
Menu, Tray, Add,Options, Options
Menu, Tray, Add
Menu, Tray, Add, On-line help, Help
Menu, Tray, Add, About, About
Menu, Tray, Add
Menu, Tray, Add, Exit, ExitLabel
Menu, Tray, NoStandard
Menu, Tray, Click, 1
Menu, Tray, Default,Convert to plain text
;Menu, Tray, Icon, plaintext.ahk_1.ico, , 1
InitializeHotkey()

return

ClickHandler:
If ((A_TickCount-firstClick) < DblClickSpeed) ; double click
{
firstClick = 0
;MsgBox,, Tray Icon Double Click,Put here actions for Double Click.
goto, ConvertText
}
Else ; Single click
{
firstClick := A_TickCount
KeyWait, LButton
KeyWait, LButton, % "D T" . DblClickSpeed/1000
IF (ErrorLevel && firstClick)
;MsgBox,, Tray Icon Single Click,Put here actions for Single Click.
goto, ConvertText
}
Return

Options:
iniread,LoadonStartup,Hotkeys.ini,Options,LoadonStartup
if LoadonStartup=1
Gui, Add, CheckBox, vLoadonStartup Checked,Load on system startup.
Else
Gui, Add, CheckBox, vLoadonStartup,Load on system startup.
Gui, Add, Button, x132 y60 w60 h30 , OK
; Generated using SmartGUI Creator 4.0
Gui, Show, x663 y263 h99 w219, Options
Return
ButtonOK:
Gui,Submit
iniwrite,%LoadonStartup%,Hotkeys.ini,Options,LoadonStartup
if LoadonStartup=1
{
regwrite,REG_SZ,HKEY_LOCAL_MACHINE,software\microsoft\windows\currentversion\run, PlainText,%A_ScriptDir%\plaintext.exe
}
Else
{
regdelete,HKLM,software\microsoft\windows\currentversion\run, PlainText
}
gui, destroy

return
GuiClose:
Gui,Destroy
return
Hots:
{
Gui,Destroy
iniread,PastePlainText,Hotkeys.ini,Hotkeys,PastePlainText
Hotkeys:="Paste plain text". ": " . ConvertShortcutName(PastePlainText) . chr(13) . chr(13)
Gui, Add, Text, x22 y20 w260 h100 , %Hotkeys%
Gui, Add, Button, x22 y100 w80 h30 , Reset
Gui, Add, Button, x112 y100 w80 h30 , Redefine
Gui, Add, Button, x202 y100 w80 h30 , Close
; Generated using SmartGUI Creator 4.0
Gui -MaximizeBox -MinimizeBox
Gui, Show, AutoSize Center, Hotkey
Return

ButtonClose:
Gui,Destroy
Return

ButtonReset:
Gui,Destroy
filedelete,Hotkeys.ini
Filecopy,HotkeysDefault.ini,Hotkeys.ini
InitializeHotkey()
return
ButtonRedefine:
suspend
Gui,Destroy
Gui, Add, Text, x3 y2 w330 h37 , Click a field and press down a hotkey combination. Leave empty if you do not want to change.

Gui, Add, Hotkey,vPastePlain
Gui, Add, Button, x162 y100 w80 h30 , Save
Gui, Add, Button, x252 y100 w80 h30 , Cancel
Gui, Add, Text, x142 y50 w200 h20 , Paste Plain Text
Gui -MaximizeBox -MinimizeBox
Gui, Show, AutoSize Center, Redefine Hotkeys
DISABLECLOSEBOX()
Return

ButtonSave:
suspend off
Gui,Submit

If PastePlain=^c
PastePlain=
If PastePlain=^v
PastePlain=

if PastePlain<>
IniWrite,%PastePlain%,Hotkeys.ini,Hotkeys,PastePlainText

InitializeHotkey()
Return

ButtonCancel:
suspend off
Gui,Destroy
return
}

Help:
run http://dallascao.com/en/plaintext/
Return
About:
Msg:="PlainText version 1.10" . chr(13) . "Coded by Dallas Cao, IT English to Chinese translator." . chr(13) . "http://dallascao.com/"
MsgBox, 4160, About, %Msg%
Return
ConvertText:
clipboard = %clipboard%
return
ExitLabel:
ExitApp
Return

PastePlainText:
clipboard = %clipboard%
Send, {CTRLDOWN}v{CTRLUP}
Return

InitializeHotkey()
{
iniread,PastePlainText,Hotkeys.ini,Hotkeys,PastePlainText
HotKey,%PastePlainText%,PastePlainText
}

ConvertShortcutName(Code)
{
stringreplace,Code,Code,^,Ctrl_
stringreplace,Code,Code,!,Alt_
stringreplace,Code,Code,+,Shift_
stringreplace,Code,Code,_,+,All
Return Code
}

DISABLECLOSEBOX() ;By RealityRipple at http://www.xtremevbtalk.com/archive/index.php/t-258725.html
{
WinGet, id, ID, A
menu:=DllCall("user32\GetSystemMenu","UInt",id,"UInt",0)
DllCall("user32\DeleteMenu","UInt",menu,"UInt",0xF060,"UInt",0x0)
WinGetPos,x,y,w,h,ahk_id %id%
WinMove,ahk_id %id%,,%x%,%y%,%w%,% h-1
WinMove,ahk_id %id%,,%x%,%y%,%w%,% h+1
}