Skip to content, Skip to search

Changes

Scripting

45 bytes added, 08:51, 17 February 2016
Creating scripts and using "refresh scripts": Clarify instructions
You can create, edit and run scripts using Fiji's script editor. For details, please see [[Using the Script Editor|the Script Editor documentation]].
= Creating Adding scripts and using "refresh scripts" to the Plugins menu =
On startup, ImageJ will run all "refresh scripts" plugins, one for each supported language. This will result in all scripts present within For the plugins folders to be added script to appear in the Plugin menus., the following must apply:
To run # The script file is saved in the <code>ImageJ.app/plugins</code> directory (or a subdirectory thereof).# The script name ends in a supported script extension. For example, ".js" for javascript, ".py" for jython, ".rb" for jruby, ".clj" for clojure, and ".bs" for beanshell script. 'NOTE:' ".txt" is not a supported scriptlanguage.# The script name contains a '_' (underscore) character, just select it from the plugins menuse.g. "MyScript_.ijm"
If you edit a The extension will be stripped and any underscores will be turned into spaces before the script that is already placed in the menus, you don't need added to do anything else: just save the text file and run it again by selecting it from the menus.
If you add Scripts in the top-level "plugins" directory will appear at the bottom of the Plugins menu. Scripts can be placed in other menus by by nesting subdirectories, for example placing a new script and ImageJ is running, just go to Plugins - Scripting and run in the appropriate Refresh * "/plugins/Scripts for /File" directory will add it to the languageFile menu.
For the If you aren't able to find your script to appear in , you can always run the Plugin menus, it needs [[Using_the_Command_Launcher|Command Finder]] to terminate in the appropriate file extension. For example, ".js" for javascript, ".py" for jython, ".rb" for jruby, ".clj" for clojure, and ".bs" for beanshell script. The script must also contain a '_' verify its location (underscoreor absence) in the name. The extension will be stripped and any underscores will be turned into spaces before the script is added to the menus.
== Running scripts in headless mode ==
Bureaucrat, emailconfirmed, incoming, administrator, uploaders
735
edits