2009年5月10日 星期日

编辑框中粘贴后自动提交

在opera中文官方社区这两个帖子学习。
http://bbs.operachina.com/viewtopic.php?f=30&t=45046
http://bbs.operachina.com/viewtopic.php?f=30&t=39791
并依葫芦画瓢,定制了几个相关的右键。

1、op_enter.vbs内容如下:
'-------------------------------------------------------------------
' Opera 选中文字后复制到编辑框粘贴后按 enter 。
'-------------------------------------------------------------------
Dim WshShell
Set WshShell = CreateObject("WScript.Shell")
WshShell.SendKeys "{enter}"

2、op_enter_ctrl.vbs内容如下:
'-------------------------------------------------------------------
' Opera 选中文字后复制到编辑框粘贴后提交。提交是按 enter+ctrl 实现。
'-------------------------------------------------------------------
Dim WshShell
Set WshShell = CreateObject("WScript.Shell")
WshShell.SendKeys "^{enter}"

并假设相关路径如下:
D:\Opera\profile\vbs\op_enter.vbs

D:\Opera\profile\vbs\op_enter_ctrl.vbs


在自己的menu.ini中[Edit Widget Popup Menu]下添加以下右键:
Item, 粘贴提交 = Paste & Delay, 100 & Execute program , "D:\Opera\profile\vbs\op_enter_ctrl.vbs"
Item, 粘贴提交后关闭 = Paste & Delay, 100 & Execute program , "D:\Opera\profile\vbs\op_enter_ctrl.vbs" & Delay, 2000 & Close Page & Switch to next page
Item, 粘贴后回车 = Paste & Delay, 100 & Execute program , "D:\Opera\profile\vbs\op_enter.vbs"

0 评论: