Difference between revisions of "Batch Jobs"
From Freeplane - free mind mapping and knowledge management software
(→Preparation) |
|||
Line 13: | Line 13: | ||
==Howto== | ==Howto== | ||
===Preparation=== | ===Preparation=== | ||
− | Install [https://sourceforge.net/projects/freeplane | + | Install [https://sourceforge.net/projects/freeplane/ Freeplane stable] and a recent [http://freeplane.sourceforge.net/wiki/index.php/Add-ons#Add-on_Developer_Tools Developer Tools add-on]. Then restart Freeplane. |
===Run a function on startup=== | ===Run a function on startup=== |
Revision as of 00:10, 20 October 2012
Freeplane is a program with a graphical user interface. - That's smart since it would be hard to create mindmaps otherwise...
But there are some cases where you might want to let Freeplane do something for you unattended especially if you have appropriate scripts. So here's what Freeplane supports in this respect:
- Open the GUI, execute one or more functions and exit afterwards,
- Execute one or more function and keep the Freeplane window opened.
All is build on two building blocks:
- All functions in the menu (e.g. scripts) are available for batch execution.
- The functions are submitted to Freeplane on the command line.
Contents
Howto
Preparation
Install Freeplane stable and a recent Developer Tools add-on. Then restart Freeplane.
Run a function on startup
Let's assume that you want to launch the "Open saved map..." function whenever you start Freeplane. This is how it works:
- Start Freeplane and invoke Tools > Developer Tools > Menu item info
- In the dialog select File > Open saved map... and click OK.
- The necessary command line argument that is printed after "Command line option:" has been copied to the clipboard.
- Open a command line window. If the Freeplane executables are not in the path variable you have to cd to the directory where freeplane.bat (on Windows) or freeplane.sh (on Linux) reside.
- On Windows type
freeplane.bat -X$OpenAction$0
- on Linux type (note that the dollar signs have to be quoted)
./freeplane.sh -X'$OpenAction$0'
Run a script and terminate
Scripts have their menu items too so most of the steps also hold for scripts.
- Find the command line option as written above. Let's assume the command line parameter is -X$MyScript_on_single_node$0
- On Windows type
freeplane.bat -S -N -X$MyScript_on_single_node$0
- on Linux type
./freeplane.sh -S -N -X'$MyScript_on_single_node$0'
- Option -S makes Freeplane stop/shutdown after executing the script.
- Option -N let's Freeplane set the system variable nonInteractive variable to true. It's upto the script to evaluate this variable like this:
boolean isInteractive() { return !Boolean.parseBoolean(System.getProperty("nonInteractive")) }
Notes
- Options without an argument can be combined with others like -SMX'$MyScript_on_single_node$0'
- If you want to execute more than one menu item use the -X option multiple times.