Developer's API
API functions
They should be accessed asAPI.function_name()
. For example API.paste()
paste(channel="", clipno="")
- Pastes clips from a certain postion in a certain channel. If both are blank, paste 1st clip from currently active channel.
Example -API.paste(1, 14)
pastes clip 14 of channel 1
getClipAt(channel=0, clipno=1, toreturn=1)
- Get a Clip's content i.e. what is contained in that clip. 'channel' and 'clipno' are the channel number and clip number respectively.
If toreturn = 1 then return Clipboard text data
If toreturn = 2 then return ClipboardAll binary data.
manageClip(new_channel=0, channel="", clip="", flag=0)
- Cut/Copy Clip from one channel to other. 'new_channel' is the new channel to place the clip in. Note that the clip will always be placed at clip 1 of new channel.
If flag = 0 then cut , if flag = 1 then copy
If channel is empty, active channel is used.
If clip is empty, active clip in [Paste-Mode] (Clip x of y, "x") is used.
emptyChannel(chno="")
- Empties a particular channel (chno)
If 'chno' is empty, it DEFAULTS to current channel.
You can also use name of a channel likeAPI.emptyChannel(web)
orAPI.emptyChannel(pit)
orAPI.emptyChannel(default)
. Note that if you are creating an AHK Script i.e. a plugin you will have to surround the channel name by quotes ("") to take it as string.
runPlugin(filename, parameters*)
- Runs a plugin. See here and then here.
runFunction(function_string)
- Runs a function
function_string - The string containing the function with parameters, likechangeChannel(1)
,inputBox(mytitle, some text to desc)
Example -API.runFunction("changeChannel(1)")
Note - ClipjumpCustom users are requested to userun=changeChannel(1)
rather than this.
disable(status)
- Disables/Enables/Toggles Clipjump
If status=1, then disable clipjump.
If status=0, then enable clipjump.
If status=-1, then toggle clipjump status.
addClip(channel, input)
- Adds a clip at the start of the channel i.e. as Clip 1
channel - The channel where the new clip is to be added
input - The text that the new clip will contain
showPasteTipAt(channel, clip)
- Opens [Paste-Mode] with clip number 'clip' of channel 'channel' active.
ExecuteSection(secName)
- Executes a section in the ClipjumpCustom.ini
IncognitoMode(p=1)
- Enable/disable Incognito Mode. Pass 1 to disable.
If p = 1 enable incognito mode
If p = 0 disable
getClipLoc(channel="", clipno="")
- get a Clip exact file location or the file in which the clip is saved
channel - The channel the clip belongs to
clipno - Clip number of the Clip
getClipDataByTag(tag)
- returns the text data of first clip which has the tag tag
blockMonitoring(yes=1)
- blocks Clipjump Clipboard monitoring. Useful when you are changing clipboard content such that you don't want it to be accounted by Clipjump
If first parameter i.e. yes = 1 , then block Monitoring.
If 0 , then unblock (or enable Clipboard monitoring)
runLabel(name)
- runs a label/routine
name - The name of the label to be run.
deleteClip(channel, clip)
- deletes a clip from a channel
channel - The channel number whose clip is to be deleted
clip - The Clip number to be deleted.
showTip(Text, forTime="")
- shows a Tip (with a different font). recommended when creating a plugin
Text - the text to show in the tip
forTime - time for which the tip is to be shown, if the paramter is not passed i.e. blank, the tip becomes permanent
removeTip()
- removes the Plugin API Tip i.e. the tip created using the above function API.showTip()
pasteText(Text)
- pastes the 'Text' that is passed to the function.
Text - the text/string you want to paste
getChStrength(channel)
- gets total number of clips in a channel i.e. population of a channel
Text2Binary(Text, byref returnVar)
- gets binary ClipboardAll data from simple text i.e. string. You pass it a string and it converts it into binary data and returns it via byref variable returnVar
Text = the string you want to convert to ClipboardAll type data
returnVar = byref variable to return ClipboardAll data
getVar(var)
andsetVar(var, value)
- gets the value of variable 'var'
- sets the value of variable 'var' to 'value'
More functions
Other interesting functions that are not a part of API.Unlike API, they should be accessed normally as
function_name()
. For example changeChannel(2)
BeepAt(value, freq, duration=150)
- Make a beep system sound.
If 'value' = 1 , then the function will beep else it will not.
freq - frequency of the beep
duration - duration of the beep to be played in milliseconds
getClipboardFormat(type=1)
- gets the type of data on Clipboard
If 'type' = 1 , then the function returns the type of data a/c Paste-Mode i.e. "[Text]" for text data including HTML , "[File/Folder]" for file,folder copied data and (blank) for Picture type data.
If 'type' = 0 , then the function returns the data type formats ID's on Clipboard as per the Microsoft list.
inputBox(title, text)
- shows a dialog for user to enter any text and the function returns that text. See More
HParse(hotkey)
- converts a normal hotkey like 'Win+Alt+Z' or 'Ctrl+PrintScreen' to AutoHotkey format like '#!z' or '^Printscreen'.
hotkey - The Standard hotkey to convert to AHK form.
The function returns the AHK formatted hotkey of the input hotkey.
changeChannel(channelno)
- Changes channel to 'channelno'
channel_find( name )
- Finds the channel corresponding to the 'name' and returns its channel number.
name - The name of the channel like 'Default'
chooseChannelgui()
- Shows a GUI for the user to select channel, if he selects a channel the function returns the selected channel number.
USAGE-ClipjumpCustomtip = %chooseChannelgui()%
USAGE-AhkScript(Plugin)zSelectedCh := chooseChannelgui()
manageChannel(channel)
- Deletes a channel with the channel number 'channel'
channel - The Channel Number of the channel to be deleted.
set_pformat( paste_format )
- Sets the Paste format which is currently active.
paste_format - The name of paste format (like 'UPPERCASE') to be made active.
USAGE -set_pformat(SentenceCase)
Labels/Routines
Labels should be accessed asrun = label_name
in ClipjumpCustom and gosub label_name
in AhkScript.- These are the labels to open various dialogs and gui in Clipjump. You can easily guess their functions from their names.
- actionmode
- settings
- history
- channelgui
- classtool
- channelGUI
- pluginManagerGui
- channelOrganizer
- These are the labels corresponding to various features of Clipjump. Again, the name itself should be explanatory.
- onetime
- holdClip
- pitswap
- incognito
- disable_clipjump
- Toggles Clipjump Status i.e. Enabled or disabled (same like Options > Disable Clipjump in Tray Menu)
- endPasteMode
- Ends [Paste-Mode] forcibly.
- simplePaste
- Pastes the current active content on System Clipboard
- windows_copy and windows_cut
- Copies / Cuts the selected text or file without copying to Clipjump i.e. only System Clipboard is affected. This is what is used inside Copy to System Clipboard bypassing Clipjump
- updt
- Check for Updates
- exit
- Exits Clipjump properly
Variables
The important variables in Clipjump which can be changed to customize much of the behavior in the program are listed below. Please note that only selected variables have been listed to prevent any issues with the core functionality of Clipjump.Changing a variable in ClipjumpCustom is done as
variable = value
and in AHKScript is done as variable := "value"
- Channel Object
- CN.NG - Holds the channel number that is currently active.
- CN.Name - The name of the channel that is currently active.
- CN.Total - Total number of channels that are currently created by the user.
- STORE Object
- Public Storage Space. Use asSTORE.var := "value"
andmsgbox % STORE.var
See also STORE in ClipjumpCustom.
- curPformat - Holds the current active paste format.
- CALLER - Holds 1 if clipboard is monitored by Clipjump and 0 if not.
- pastemodekey and spmkey
- Use aspastemodekey.key
ORspmkey.key
to change keys currently used in [Paste Mode] and [Search-Paste Mode].
See here for an example.
Public API
Public API (publicAPI.ahk) gives power to any Ahk Script as well an external plugin to control all aspects of Clipjump from changing and reading variables to running function and labels. It is by default distibuted with Clipjump and present in the Clipjump.exe directory.Here is the online github link in case it ever updates
An external plugin can include publicapi as
#Include %A_ScriptDir%\..\publicAPI.ahk
Once publicAPI is included in the script, you will have to initialize it.
cj := new Clipjump() ; The name 'cj' doesnt matter
Then you can call API methods, set variables, get variables and so on using the 'cj' object. Here are few examples -; getting value of internal variable VERSION msgbox % cj.version ; getting value of internal variable CN.NG msgbox % cj["CN.NG"] ; setting internal variable PASTEMODEKEY.Z to Y cj["pastemodekey.z"] := "y" ; running a API function GETCLIPLOC msgbox % cj.getClipLoc(1, 5) ; running a normal function SET_PFORMAT that is not part of API cj.runFunction("set_pformat(NO-FORMATTING)") ; running the label EXIT cj.runLabel("exit") ; closes ClipjumpThe plugin Ignored Windows Manager uses the publicAPI. It will be a good idea to read its code ( external.ignoreWManager.ahk ).
Translate