Custom
[v10.6+]
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-
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.
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
Besides this you can also change the inner variables of Clipjump by using the
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.
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
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
Note It must be noted that Clipjump doesn't support nesting of
So to get started, know that 'Send' has some rules which must be noted.
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 -
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
The last parameter flag is 0 for move and 1 for copy. Here we are moving the clip.
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.
Translate
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 iscommand = value
.
- 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
- 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. - Shows a tooltip with the text which is passed as value.
Example -tip = some text to show as tip
- 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}
andsend = 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. - 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 - 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.
Examples
Example 1 (Shortcut to toggle Incognito Mode)
The above code uses 3 commands, bind, run and tip.- Bind creates a shortcut for the section meaning that the section will not auto-execute at Clipjump start. Here that shortcut is Win + Alt + I.
- run runs the label 'incognito' inside Clipjump which is responsible for toggling incognito mode. More labels are here
- tip shows a tooltip when this custom function is run. Here the tip shown will contain the text Incognito Mode toggled.
noautorun=1
to prevent auto-execution of section even if it doesn't have a 'bind'.
Example 2 (changing paste-format key to Y)
The above code changes the inbuilt variablepastemodekey.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 key names are according to the AutoHotkey key list.
Example 3 (Shortcut to check for updates)
- updt is label used in Clipjump to update and the run command runs it.
- As you see, it is not necessary to keep bind at the first line of the section. It can be anywhere.
Example 4 (Shortcut to paste current content on system clipboard instantly [without formatting])
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.Example 6 (Running a ClipjumpCustom script with Action Mode)
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.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. TheACTIONMODE.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 functionAPI.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 -
Example 7.5 (Getting the clip to paste)
You can use the inbuiltinputbox()
function to retrieve the clipno to paste. This procedure can also be done for the channelno.
- 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.
Example 8 [SEND] (Filling Form)
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}
orsend={Enter}
orsend={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 theAPI.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
The last parameter flag is 0 for move and 1 for copy. Here we are moving the clip.
Example 10 (paste mode with search enabled; no need to hold Ctrl)
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.Example 11 (emptying a channel)
The above uses theAPI.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.
Example 12 (Variables concept and STORE.)
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 nornoautorun=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 functionAPI.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.
Translate