- The filename
- Plugin parameters
- Script/Function parameters
- Plugin Classes
- Things to Note
- Developers Complete List
Some plugins are included in the program at runtime, some are not (external class). There is no limit on the number of plugins and they can be always accessed from the Plugin Manager (ActionMode = M)
If filename is myplugin.ahk , it means the plugin file contains a
plugin_myplugin()that is run by the Plugin Manager or
API.runPlugin(). If the filename is pformat.noformatting.ahk , the main function the file has is
;@Plugin-. These hold the key-value pairs that have information about the Plugins.
;@Plugin-Name myplugingives the key name for the plugin the value myplugin. As you may have guessed this is the same thing you see when you click on Properties in the Plugin Manager.
There is no limit on what can be the 'key' here. Even
;@Plugin-authorSite http://mysite.comalso works and is shown in the Properties window.
;@Plugin-param(N)where N is a natural number are the Function parameters (like
;@Plugin-Param1). They hold information about the Nth parameter of the main function in the plugin file. When you run a plugin with
API.runPlugin( plugin_filename , param1, param2 ....)without any 'param's , the function auto-asks you the parameters showing these informations if they are present. You can provide a parameter as
;@Plugin-Silent 1to force
API.runPlugin()to not ask the user for parameters even if no parameter is passed to it.
Function parameters are not Mandatory but it is recommended to provide them.
- Variable Names in plugin files that are included (not external) should start with z. This is because Clipjump doesn't uses any variable starting with 'z' and so this is the best option to avoid variable conflicts.
- The parameter names in the function definition (
plugin_myplugin(zParam1, zParam2)) should also start with 'z'.
STORE.myvar := "text"and
zVar := STORE.myvar
As already said, these files have main function like
plugin_a_b(). Currently Clipjump has 2 defined classes. User is not allowed to create them. (i.e. create a file like xyzPlugin.coreScript.ahk)
- These plugins also have a custom mandatory parameter
;@Plugin-Previewablewhich should hold 1 if the paste format is previewable in Paste Mode. It is 1 for SentenceCase.
- These Plugins should make
STORE.ClipboardChangedtrue if they have successfully changed the input variable and thus what is going to be pasted.
STORE.ClipboardChanged := true
- It should be noted that these plugins (should) have 1 input parameter. See the file 'pformat.sentencecase.ahk' for example.
- When toggling and when pasting, Clipjump inputs the Clipboard variable and not the ClipboardAll variable as the first parameter. If the plugin needs the ClipboardAll variable, it can consult it anytime as it will be the same as what current active
The Parameters in external plugins ? Like Function parameters , the external script file can contain
-Param2and so.. for the
API.runPlugin()to take them as Script parameters and thus ask the user if they pass no paramter.
For example try running the external.controller.ahk and then seeing its source code.
;@Plugin-Silent 1to make
API.runPlugin()not ask the user for parameters even if user doesn't enters them.
- It will be a good idea to use
- While testing keep in mind that your plugin will be included in Clipjump.ahk and thus run from the directory of Clipjump.ahk. So be careful with the WorkingDir factor.
- There will be no auto-execution of any plugin as a non-external plugin will be included at the bottom of Clipjump.ahk
- Please reload Clipjump when you change/add a plugin file to load it into Clipjump.
- Make sure to have a look at The Complete Developer List and the public API