ClipjumpCustom.ini is the medium to create scripts for Clipjump. Usually a script has 3-5 lines of code but can accomplish a lot.
The file is created and loaded when you start Clipjump.
It gives power to-
Change previously unchangeable shortcuts
bind a hotkey to an action (like a hotkey to toggle Incognito Mode)
run inbuilt labels and functions to tailor-make any complex user function.
run a plugin at will or at required condition
send key-presses to facilitate scripting / macro
The basics
Clipjump Custom works on the principle of Sections ([section_name]) in Ini's. Each section in ClipjumpCustom.ini behaves as an independent script. You can add commands which is a key=value pair in these sections and they will be executed one by one when the section runs.
The sections are of 2 types - Auto-executing and Non-auto-executing .
The only difference between them, as the name suggests is that an Auto-executing section runs at Clipjump startup whereas it is not so for the other type.
A section becomes non-auto-executing only when it has a hotkey linked to it or when noautorun is set to 1 in that section. You will learn more on this topic later.
How it works ?
ClipjumpCustom.ini is interpreted by Clipjump at its startup. The ini is scanned for auto-executing sections and these are executed as soon as they are found. All sections are then kept in memory and executed later on when called.
So if you edit the ClipjumpCustom.ini while Clipjump is running, the change is not recorded by Clipjump. Therefore you need to reload ClipjumpCustom.ini from the tray menu.
Here is an example ClipjumpCustom.ini file
Commands
Here is the list of commands you can use in your ClipjumpCustom section (script). The syntax of all of these commands is
command = value.
run
Runs a label or function or API function distributed with Clipjump. For a complete list of these, see API functions and routines list.
See an example of using Run command here
bind
Binds a hotkey to the current section. This hotkey when pressed will execute that section. The bind command or rather the bind key can be present
anywhere in the section to be recognizable.
It should also be noted that a section having a bind key doesn't autorun with Clipjump i.e. the section becomes non-auto-executing type.
See this example using bind.
tip
Shows a tooltip with the text which is passed as value.
Example - tip = some text to show as tip
send
Artificially presses the key sequence that is passed as value. Example -
send = first line{enter}second line{tab}also in second line
The syntax is based on the AutoHotkey's send command. Use braces {} when you want to press the actual key.
Example - send = {Enter} and send = Enter produce different results. The first one presses the key Enter
whereas the second one writes "Enter".
See this example on send to learn more.
sleep
Pauses the execution of section for the passed time in milliseconds.
Example - sleep = 1500 pauses the execution of running thread for 1500 milliseconds i.e 1.5 seconds
noautorun
If this variable is set to 1 anywhere in the section, the section doesn't auto-execute even without using the bind command.
Example - noautorun=1
Set this variable to 0 in a non-auto-executing section ( like the one using bind command ) to make it autorun.
Besides this you can also change the inner variables of Clipjump by using the variable = value syntax. Some of the most common variables
needed to work highly requested features have been given in the following examples. Go through them and explore interesting tweaks and possibilities. Note - The option to reload ClipjumpCustom.ini provided in the tray menu doesn't execute the auto-executing sections of the ini.
If you change/add an auto-executing section in the ini, you will have to restart Clipjump to load them.
The above code changes the inbuilt variable pastemodekey.z to 'y'.
If you remember, Z is the default key for toggling Paste formats in Paste Mode. The above code changes it to Y. It is mandatory to write pastemodekey in pastemodekey.z because pastemodekey is the object name which has
this setting.
The Pastemode group has all variables as pastemodekey.key where key is the original key. Same is for [Search-Paste Mode]. It has all variables as spmkey.key. So the following code will change Channel up, Channel down and paste-format shortcut in [Paste-Mode] and cancel shortcut in [Search-Paste Mode].
The above code has 2 examples, [paste_current] is to paste current clipboard as it is and [paste_without_formatting] is to paste current clipboard
without formatting.
simplePaste is label in Clipjump to paste current content on Clipboard.
API.runPlugin( plugin_path ) runs a plugin file. Here in the 2nd section, it runs the plugin file noformatting_paste.ahk which is supposed to contain the code to paste without formatting. Learn more about API.runPlugin().
Another thing to note here is the use of quotes around noformatting_paste.ahk. As in a function call, arguments are separated by comma (,), so it is advisable to use quotes around arguments to separate literal comma from the one meant to partition arguments.
Example 5 (Instantly switching to your favorite channel)
Suppose your favorite channel is #4 as it stores some important web links. We will use the inbuilt changeChannel function in Clipjump to do the purpose.
[changeto_4]bind=Win+4run=changeChannel(4)tip=Channel changed to 4
Suppose you don't want to create a separate shortcut Win+V for the above example. Here is how to create a [Action Mode] shortcut for it.
[changeto_4]noautorun=1; noautorun prevents auto-execution of a section in absence of bind
run=changeChannel(4)tip=Channel changed to 4[actionmode_f10]; here I don't use noautorun as I want it to run at startup and make the change
ACTIONMODE.F10=API.executeSection(changeto_4)ACTIONMODE.F10_caption=Change 2 my channel
API.executeSection( section_name ) can be used to execute any section any time. section_name is the name of the section to be executed.
[Action-Mode] keys are customizable with the ACTIONMODE.key variable. The ACTIONMODE.key_caption variable holds the caption for the action shown in [Action-Mode].
The ACTIONMODE.key on the other hand holds the label/function/routine to be executed when the key is pressed. Here we are executing the function API.executeSection() with the first parameter as changeto_4
Example 7 (Paste Your Contact Details)
If you give a unique tag to a clip with some specific information, then it can be retrieved anytime using the getclipDataByTag() function and pasted using the pasteText() function.
Here my_address is the tag that your contact details clip has.
Note It must be noted that Clipjump doesn't support nesting of %..%. So something like zAddr = %API.getClipDataByTag(%some_variable%)% is invalid. However the output of run command is stored in variable ans.So the above code can be written as -
[paste_address]bind=Ctrl+F8run=API.getClipDataByTag(my_address) ; now you can use API.getClipDataByTag(%some_variable%)
run=API.pasteText(%ans%)
You can use the inbuilt inputbox() function to retrieve the clipno to paste. This procedure can also be done for the channelno.
[paste_sig]bind=Ctrl+F8zClipno=1; zClipno = %inputbox("Choose", "Please write the clip number to be pasted")%
run=API.paste( 2, %zClipno% )
In the line zClipno = 1, zClipno is a user created variable that is assigned the value of 1.
The variable is fed into API.paste() function by wrapping it with %....% . So you can say that %...% is used to declare that something is a variable i.e. NOT Literal TEXT.
In the commented line containing %inputbox...% the variable zClipno is assigned the return value of inputbox() function. As the whole function call is NOT supposed to be A FIXED TEXT, we have used %...% over it. You can try un-commenting that line and then restarting Clipjump to see what happens.
inputbox( title , caption_text ) is basically a function that shows a dialog box for the user to enter text. Once text is entered and OK is pressed, the function returns the text entered by user to the variable calling it.
The first example using Send. As briefed above, the command sends or stimulates a key press.
So to get started, know that 'Send' has some rules which must be noted.
To simulate key combination press like Win + C, use send=Win+C. When pressing key combination using send, keep it in a single line.
To simulate a key press like Tab or PageDown, use send={Tab} or send={Enter} or send={tab}{enter} if you want both.
To write text using send command like 'Hi there', use send=Hi there.
Situation - Suppose you want to fill a web form with 4 fields and the fields focus can be switched with TAB, here is the customization to use -
Keep focus on the first of the 4 fields and press Ctrl + Shift + F9 and watch all the other 4 fields filled automatically.
As you may have read in example 7, API.paste() pastes clipno from channelno. If channelno is blank (like here), it defaults to the current active channel.
You may use sleep=500 to wait for a particular time in milliseconds.
Example 9 (moving clips)
We will use the API.manageClip(new_channel, channel, clip, flag) function here. channel and clip default to the
current active ones if no value for them is passed. Situation - Suppose you copied a trash / incorrect information in the current protected / normal channel accidentally. Here is the code to move it to
Pit channel which is say at channel number 2
[trash_clip]bind=Ctrl+Win+Delrun=API.manageClip(2,,,0)tip=The current active clip was trashed
The last parameter flag is 0 for move and 1 for copy. Here we are moving the clip.
If you don't like holding down Ctrl to navigate clips, this if for you. This Customization will bind Win + V to open paste mode with Search enabled so you will be able to use Up/Down keys to navigate through the clips.
[empty_pit]bind=Win+Alt+Erun=API.emptyChannel(pit)tip=Pit Channel is now empty
The above uses the API.emptyChannel(channel_no) function. If channel_no is empty i.e nothing is passed as this
parameter , the current active channel is taken into account.
If channel_no is not number, a channel with name as channel_no is taken into account. If channel_no is
number, it is supposed that channel_no contains a channel number to be used.
[SEC1]STORE.myVar=text in store.myvaranotherVar=text in anotherVartip=%STORE.myVar%sleep=1000tip=%anotherVar%sleep=1000[SEC2]tip=Sec2 is now startedsleep=1000run=API.showTip(%STORE.myVar%, 1000)tip=%anotherVar%sleep=1000
STORE.varname can be used by users to create variables that are saved all through Clipjump runtime and can be accessed anywhere.
In the above code, both SEC1 AND SEC2 neither have bind nor noautorun=1 so they will run at Clipjump startup.
SEC1 will run before SEC2 and will add values to the variables 'STORE.myVar' and 'anotherVar'.
A tip confirms what the value is stored in these variables. Note that tip default shows for 1000 milliseconds (1 second) and so we use sleep=1000 to pause execution for that time so that tip is properly shown. You can also use the function API.showTip(text, time_in_ms) as I have used in SEC2 as 'API.showTip(%STORE.myVar%, 1000)'.
When the above customization runs, you will see that tip containing %anotherVar% is not shown in SEC2. It is because %anotherVar% is unaffective there. It's lifetime was only till SEC1 where it was created.
%STORE.myVar% on the other hand will be active at all times and you will see its tip in SEC2.
Note - A list of all API functions, key label, routines and general functions and Interesing Variables can be found on
Developer's Reference Page.
It is recommended to have a look at them when you complete this guide.
If you need help on Customizations, you can ask in comments on the main site or from any of links in the
contact page.