Difference between revisions of "Init scripts"

From Freeplane - free mind mapping and knowledge management software
(Created page with "Starting with 1.5.8 Freeplane supports init scripts, i. e. scripts that are executed on startup. This is especially useful for scripts that change the behavior of Freeplane, e...")
 
 
Line 8: Line 8:
 
If you need map specific behavior encode this in your scripts by checking the name of the current map.
 
If you need map specific behavior encode this in your scripts by checking the name of the current map.
  
TODO: Put some examples of useful init scripts here
+
== Examples ==
 +
 
 +
* [[Scripts_collection#Register_a_Markdown_IContentTransformer|Register a Markdown IContentTransformer]]
 +
* An extended script can be found in this [[http://sourceforge.net/p/freeplane/discussion/758437/thread/748f90ad/?limit=25#c37d|forum article]].
  
 
[[Category:Script]]
 
[[Category:Script]]

Latest revision as of 23:27, 18 September 2016

Starting with 1.5.8 Freeplane supports init scripts, i. e. scripts that are executed on startup. This is especially useful for scripts that change the behavior of Freeplane, e. g. via listeners that listen on events like opening maps, mouse or keyboard events.

So here are the rules (may change until 1.5 is declared stable):

  • Init scripts are all scripts in the directory <freeplaneuserdir>/scripts/init/.
  • After startup (Freeplane window is up) all init scripts are run in lexicographical order of script names.
  • In an init script you can't rely on the variable node since it is not bound. You also should not assume that any script map is opened.

If you need map specific behavior encode this in your scripts by checking the name of the current map.

Examples