External Programs and Filters: Difference between revisions
No edit summary |
|||
Line 9: | Line 9: | ||
}} | }} | ||
{{toc}} | |||
External programmes can be called from within Bluefish. The currently opened file can be given as a parameter. External programmes are divided into three parts: | |||
# '''external commands: '''With an external command you can just open a file in an other programme, e.g. a browser. If that programme changed the file, Bluefish will warn you some moments later. | |||
# '''external filters:''' In contrast to external commands, external filters give a return value. | |||
# '''output box:''' Programmes in that category opens also the output box at the bottom of Bluefish. | |||
By default, for all three are already defined commands. | |||
{{note|text='''Note''': The external programmes are not necessarily installed on your computer, so you may have to install them at first. Bluefish will give you a warning if that programme is not installed.}} | |||
= External commands = | |||
External commands are mostly browsers. The external commands can be reached through ''Tools → Commands''. With the ''Preview in Browser ''button on the toolbar you can open the default browser, which is also an external programme. | |||
== Customising external commands == | |||
For customising external commands you have to open the ''Preferences'' dialog either through ''Edit → Preferences'' or the ''Preferences'' button on the toolbar. Select ''External commands'' in the left panel. | |||
There are four columns for editing external commands: | |||
* '''Enabled:''' If this is checked, you are able to reach that command through ''Tools → Commands''. | |||
* '''Label:''' The name of the command in menu. | |||
* '''Command:''' Here is the command. | |||
* '''Default browser:''' The checked programme can accessed through the ''Preview in Browser'' button at the toolbar. | |||
These are the options for external commands: | |||
{| style="border-spacing:0;" | |||
| colspan="2" style="border:0.05pt solid #000000;padding:0.097cm;"| '''Input options''' | |||
|- | |||
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| | | |||
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| start with a | to send the input to the standard input | |||
|- | |||
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| %f | |||
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| local file name (available for local files) | |||
|- | |||
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| %i | |||
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| temporary file name for input, equals %f if the document is not modified and local | |||
|- | |||
| colspan="2" style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| '''Other options''' | |||
|- | |||
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| %a | |||
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| additional arguments that will be asked when this filter is activated | |||
== | |- | ||
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| %c | |||
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| local directory of file (available for local files) | |||
|- | |||
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| %n | |||
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| file name without path (available for all titled files) | |||
|- | |||
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| %u | |||
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| URL (available for all titled files) | |||
|- | |||
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| %p | |||
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| preview URL if basedir and preview dir are set in project settings, else identical to %u | |||
''' | |} | ||
= External filters = | |||
The external commands can be reached through ''Tools → Filters''. | |||
== Customising external filters == | |||
For customising external commands you have to open the ''Preferences'' dialog either through ''Edit → Preferences'' or the ''Preferences'' button on the toolbar. Select ''External filters'' in the left panel. | |||
There are three columns for editing external filters: | |||
* '''Enabled:''' If this is checked, you are able to reach that filter through ''Tools → Filters''. | |||
* '''Label:''' The name of the filter in menu. | |||
* '''Command''': Here is the filter itself. | |||
These are the options for external filters: | |||
{ | {| style="border-spacing:0;" | ||
| colspan="2" style="border:0.05pt solid #000000;padding:0.097cm;"| '''Input options''' | |||
# | |- | ||
# | | style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| | | ||
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| start with a | to send the input to the standard input | |||
|- | |||
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| %f | |||
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| local file name (requires local file, cannot operate on selection) | |||
|- | |||
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| %i | |||
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| temporary file name for input | |||
|- | |||
| colspan="2" style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| '''Output options''' | |||
# | |||
# | |||
# | |||
|- | |||
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| | | |||
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| end with a | to read the output from the standard output | |||
|- | |||
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| %o | |||
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| temporary file name | |||
# | |- | ||
# | | style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| %t | ||
# | | style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| temporary file name for both input and output (for in-place-editing filters, cannot operate on selection) | ||
|- | |||
| colspan="2" style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| '''Other options''' | |||
|- | |||
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| %a | |||
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| additional arguments that will be asked when this filter is activated | |||
== | |- | ||
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| %c | |||
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| local directory of file (requires local file) | |||
|- | |||
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| %n | |||
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| file name without path (available for all titled files) | |||
|- | |||
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| %u | |||
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| URL (available for all titled files) | |||
|- | |||
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| %p | |||
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| preview URL if basedir and preview dir are set in project settings, else identical to %u | |||
|} | |||
= Output box = | |||
The external commands can be reached through ''Tools → Outputbox''. | |||
== Customising output box == | |||
For customising external commands you have to open the ''Preferences'' dialog either through ''Edit → Preferences'' or the ''Preferences'' button on the toolbar. Select ''Output parsers'' in the left panel. | |||
There are seven columns for editing external filters: | |||
* '''Enabled:''' If this is checked, you are able to reach that command through ''Tools → Filters''. | |||
* '''Name:''' The name of the command in menu. | |||
* '''Pattern''': Here is a regexp pattern send with the command. | |||
* '''File #''' | |||
* '''Line #''' | |||
* '''Output #''' | |||
* '''Command: '''Here is the command. | |||
These are the options for the output box: | |||
{| style="border-spacing:0;" | |||
| colspan="2" style="border:0.05pt solid #000000;padding:0.097cm;"| '''Input options''' | |||
# | |||
|- | |||
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| | | |||
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| start with a | to send the input to the standard input | |||
|- | |||
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| %f | |||
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| local file name (requires local file, cannot operate on selection) | |||
# | |- | ||
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| %i | |||
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| temporary file name for input | |||
== | |- | ||
| colspan="2" style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| '''Output options''' | |||
|- | |||
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| | | |||
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| end with a | to read the output from the standard output | |||
|- | |||
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| %o | |||
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| temporary file name | |||
|- | |||
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| %t | |||
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| temporary file name for both input and output (for in-place-editing "filters, cannot operate on selection) | |||
|- | |||
| colspan="2" style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| '''Other options''' | |||
|- | |||
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| %a | |||
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| additional arguments that will be asked when this filter is activated | |||
|- | |||
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| %c | |||
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| local directory of file (requires local file) | |||
|- | |||
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| %n | |||
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| file name without path (available for all titled files) | |||
|- | |||
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| %u | |||
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| URL (available for all titled files) | |||
|- | |||
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| %p | |||
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| preview URL if basedir and preview dir are set in project settings, else identical to %u | |||
# | |||
# | |||
# | |||
# | |||
|} | |||
Revision as of 20:42, 20 February 2015
External programmes can be called from within Bluefish. The currently opened file can be given as a parameter. External programmes are divided into three parts:
- external commands: With an external command you can just open a file in an other programme, e.g. a browser. If that programme changed the file, Bluefish will warn you some moments later.
- external filters: In contrast to external commands, external filters give a return value.
- output box: Programmes in that category opens also the output box at the bottom of Bluefish.
By default, for all three are already defined commands.
|
External commands
External commands are mostly browsers. The external commands can be reached through Tools → Commands. With the Preview in Browser button on the toolbar you can open the default browser, which is also an external programme.
Customising external commands
For customising external commands you have to open the Preferences dialog either through Edit → Preferences or the Preferences button on the toolbar. Select External commands in the left panel.
There are four columns for editing external commands:
- Enabled: If this is checked, you are able to reach that command through Tools → Commands.
- Label: The name of the command in menu.
- Command: Here is the command.
- Default browser: The checked programme can accessed through the Preview in Browser button at the toolbar.
These are the options for external commands:
Input options | |
| | start with a | to send the input to the standard input |
%f | local file name (available for local files) |
%i | temporary file name for input, equals %f if the document is not modified and local |
Other options | |
%a | additional arguments that will be asked when this filter is activated |
%c | local directory of file (available for local files) |
%n | file name without path (available for all titled files) |
%u | URL (available for all titled files) |
%p | preview URL if basedir and preview dir are set in project settings, else identical to %u |
External filters
The external commands can be reached through Tools → Filters.
Customising external filters
For customising external commands you have to open the Preferences dialog either through Edit → Preferences or the Preferences button on the toolbar. Select External filters in the left panel.
There are three columns for editing external filters:
- Enabled: If this is checked, you are able to reach that filter through Tools → Filters.
- Label: The name of the filter in menu.
- Command: Here is the filter itself.
These are the options for external filters:
Input options | |
| | start with a | to send the input to the standard input |
%f | local file name (requires local file, cannot operate on selection) |
%i | temporary file name for input |
Output options | |
| | end with a | to read the output from the standard output |
%o | temporary file name |
%t | temporary file name for both input and output (for in-place-editing filters, cannot operate on selection) |
Other options | |
%a | additional arguments that will be asked when this filter is activated |
%c | local directory of file (requires local file) |
%n | file name without path (available for all titled files) |
%u | URL (available for all titled files) |
%p | preview URL if basedir and preview dir are set in project settings, else identical to %u |
Output box
The external commands can be reached through Tools → Outputbox.
Customising output box
For customising external commands you have to open the Preferences dialog either through Edit → Preferences or the Preferences button on the toolbar. Select Output parsers in the left panel.
There are seven columns for editing external filters:
- Enabled: If this is checked, you are able to reach that command through Tools → Filters.
- Name: The name of the command in menu.
- Pattern: Here is a regexp pattern send with the command.
- File #
- Line #
- Output #
- Command: Here is the command.
These are the options for the output box:
Input options | |
| | start with a | to send the input to the standard input |
%f | local file name (requires local file, cannot operate on selection) |
%i | temporary file name for input |
Output options | |
| | end with a | to read the output from the standard output |
%o | temporary file name |
%t | temporary file name for both input and output (for in-place-editing "filters, cannot operate on selection) |
Other options | |
%a | additional arguments that will be asked when this filter is activated |
%c | local directory of file (requires local file) |
%n | file name without path (available for all titled files) |
%u | URL (available for all titled files) |
%p | preview URL if basedir and preview dir are set in project settings, else identical to %u |