Insert clipboard
- Author
- Message
-
Offline
- Posts: 47
- Joined: Fri Mar 27, 2015 7:46 am
Insert clipboard
I know how to insert selected text with the \s switch, but is there something similar for inserting the clipboard content, such as \cp or any other way to get the current clipboard text inserted?
-
Offline
- Posts: 47
- Joined: Fri Mar 27, 2015 7:46 am
Thank you KDJ,
after reading about those 2 methods, I am still in the dark how to pull this off. Maybe it's best to nail it down step by step:
1) There is nothing similar to
that would allow me to simply exchange the \s - part for say, \clipboard or something like that? Is this correct?
2) The clipboard text is read into a variable that I must declare up front, then call the method to fill it with the clipboard content. Still correct?
3) How do I get this variable into the parentheses of AkelPad.ReplaceSel()?
4) And how do I squeeze all of the above into my toolbar entry?
Would you please point me to other rescources that deal with 3) and 4) in particular. I could not find help material that would close that gap.
Thank you.
after reading about those 2 methods, I am still in the dark how to pull this off. Maybe it's best to nail it down step by step:
1) There is nothing similar to
Code: Select all
[b]\s[/b]
that would allow me to simply exchange the \s - part for say, \clipboard or something like that? Is this correct?
2) The clipboard text is read into a variable that I must declare up front, then call the method to fill it with the clipboard content. Still correct?
3) How do I get this variable into the parentheses of AkelPad.ReplaceSel()?
4) And how do I squeeze all of the above into my toolbar entry?
Would you please point me to other rescources that deal with 3) and 4) in particular. I could not find help material that would close that gap.
Thank you.
-
Offline
- Posts: 1949
- Joined: Sat Mar 06, 2010 7:40 pm
- Location: Poland
Akuro
We can use the standard script EvalCmd.js for evaluate this expression (JScript):Command for Hotkeys plugin:
Command for Toolbar plugin:
--------
Added:
Also you can save this expression in the file named eg. InsertFromClipboard.js (in directory ...\AkelPad\AkelFiles\Plugs\Scripts\) and use command:
We can use the standard script EvalCmd.js for evaluate this expression (JScript):
Code: Select all
AkelPad.ReplaceSel("[b]" + AkelPad.GetClipboardText() + "[/b]");
Code: Select all
Call("Scripts::Main", 1, "EvalCmd.js", `AkelPad.ReplaceSel("[b]" + AkelPad.GetClipboardText() + "[/b]");`)
Code: Select all
"Insert from clipboard" Call("Scripts::Main", 1, "EvalCmd.js", `AkelPad.ReplaceSel("[b]" + AkelPad.GetClipboardText() + "[/b]");`) Icon(9)
Added:
Also you can save this expression in the file named eg. InsertFromClipboard.js (in directory ...\AkelPad\AkelFiles\Plugs\Scripts\) and use command:
Code: Select all
Call("Scripts::Main", 1, "InsertFromClipboard.js")