HotPaste Plugin


Introduction

HotPaste plugin, an idea inspired from AutoHotkey hotstrings helps you create hot-words that perform action when you type. The basic actions can be pasting a text from a Clipjump channel or through a function.
Raw strings can be pasted from API.pasteText() function whereas clips can be pasted from API.paste(channel, clip) function. The pasteText() will only be able to paste unformatted text so for any HTML or picture type of clip, you will have to rely on paste().
You can create Hotpastes (i.e. "Hot-words") in the plugins\hotpaste.lib\base.ahk file. This file in not distributed by default and you will have to run HotPaste from the Plugin Manager to have this file created. Once created, you will have to edit the file to add your HotPastes.
After editing base.ahk, restart Clipjump to have your edits loaded.

Basic syntax and Usage

A simple base.ahk goes as-
; writing 'cj_site' followed by a space/Enter/Tab will PASTE the site URL
::cj_site::
	API.PasteText("http://clipjump.sourceforge.net")
	return

; writing 'my_add' followed by a space/Enter/Tab will PASTE 2nd clip of channel 0
::my_add::
	API.Paste(0, 2)
 	return
The above code creates two HotPastes - cj_site and my_add.
So the basic syntax is -
::HOTPASTE::
	API.Paste or API.pasteText
	return
If you have knoweledge of AutoHotkey, there is no limit to what HotPaste can do for you. After all, HotPaste is a simple plugin that uses the core feature of AutoHotkey for its purpose.
BTW, this doesn't mean you will have to learn AutoHotkey (AHK) to use it. This simple tutorial will be sufficient.

Examples

Pasting multi-line text

Multiline separator in Autohotkey is `n.
::longstr::
	API.PasteText("103, Abc road`nCantt. Area`nXyz`nIndia")
	return

Pasting 2nd clip of current channel

CN.NG variable contains the current active channel number. See more variables.
::2ndlast::
	API.Paste( CN.NG, 2 )
	return

End notes







Translate