Files
Shell/docs/syntax/dynamic.html
T
2023-03-06 09:18:15 +01:00

683 lines
25 KiB
HTML

<h4 id="dynamic-items">Dynamic Items</h4>
<br/>
<p>The <code>dynamic</code> section adds <strong>new menu items</strong> to the context menu.</p>
<h5 id="dynamic-sub-items">Sub-items</h5>
<p>The section can have the following entry types, all of which are <strong>optional</strong>:</p>
<ul>
<li>One <a href="variables.html" style="border-bottom: 1px solid currentColor;"> <code>var</code> block</a> to
define "local" variables.
</li>
<li>One or more <a href="#item" style="border-bottom: 1px solid currentColor;"><code>item</code> entries</a>. These
appear as top-level items in a context menu.
</li>
<li>One or more <a href="#menu" style="border-bottom: 1px solid currentColor;"><code>menu</code> entries</a>. These
appear as top-level sub-menus in a context menu.
</li>
<li>One or more <a href="#separator" style="border-bottom: 1px solid currentColor;"><code>separator</code>
entries</a>. These create a horizontal line between the given entries.
</li>
<li>One or more <code>imports</code>. The content of the given file will be placed in the position of the import.
</li>
</ul>
<p>While the <code>var</code> block should be at the top of the section, the other entries can appear in any order.</p>
<h5 id="dynamic-items-examples">Example</h5>
<p>In the following example, one top-level <a href="#item"
style="border-bottom: 1px solid currentColor;"><code>item</code></a> is created, that is separated with a <a
href="#separator" style="border-bottom: 1px solid currentColor;">horizontal line</a> from an adjacent sub-<a
href="#menu" style="border-bottom: 1px solid currentColor;"><span class="is-family-monospace">menu</span></a>,
which in turn has one sub-<a href="#item" style="border-bottom: 1px solid currentColor;"><span
class="is-family-monospace">item</span></a>
on its own:</p>
<pre><code class="lang-shell">shell
{
dynamic
{
item(title = 'Hello, World!')
separator
menu(title = 'sub menu' image = #0000ff)
{
item(title = 'test sub-item')
}
}
}</code></pre>
<br/>
<h4 id="item">Items</h4>
<p><span class="is-family-monospace">item</span>s create a single menu entry.</p>
<h5 id="item-properties">Properties</h5>
<p>Only the <a href="#property-title" style="border-bottom: 1px solid currentColor;"><code>title</code> property</a> is
mandatory (set to a non-null value). Please refer to the <a href="#properties"
style="border-bottom: 1px solid currentColor;">properties section</a> below for further details.</p>
<h5 id="item-syntax">Syntax</h5>
<pre><code class="lang-shell">item( title = value [property = value [...] ])</code></pre>
<br/>
<h4 id="menu">Menus</h4>
<p><span class="is-family-monospace">menu</span> entries create a new <strong>sub-menu</strong>. They have properties
and sub-entries.</p>
<h5 id="menu-properties">Properties</h5>
<p>Only the <a href="#property-title" style="border-bottom: 1px solid currentColor;"><code>title</code> property</a> is
mandatory (set to a non-null value). Please refer to the <a href="#properties"
style="border-bottom: 1px solid currentColor;">properties section</a> below for further details.</p>
<h5 id="menu-sub-items">Sub-items</h5>
<p><span class="is-family-monospace">menu</span>s can have the following entry types, all of which are
<strong>optional</strong>:</p>
<ul>
<li>One <a href="variables.html" style="border-bottom: 1px solid currentColor;"><code>var</code> block</a> to
define "local" variables.
</li>
<li>One or more <a href="#item" style="border-bottom: 1px solid currentColor;"><code>item</code> entries</a>.
</li>
<li>One or more sub-<a href="#menu" style="border-bottom: 1px solid currentColor;"><code>menu</code> entries</a>.
</li>
<li>One or more <a href="#separator" style="border-bottom: 1px solid currentColor;"><code>separator</code>
entries</a>. These create a horizontal line between the given entries.
</li>
<li>One or more <code>imports</code>. The content of the given file will be placed in the position of the import.
</li>
</ul>
<h5 id="menu-syntax">Syntax</h5>
<pre><code class="lang-shell">menu( title = value [property = value [...] ])
{
[ item() [...] ]
[ menu(){} [...] ]
[ separator [...] ]
[ import 'path/to/import.nss' [...] ]
}</code></pre>
<br/>
<h4 id="separator">Separators</h4>
<p><span class="is-family-monospace">separator</span>s create a horizontal line.</p>
<h5 id="separator-properties">Properties</h5>
<p><span class="is-family-monospace">separator</span>s do not have any mandatory properties. Please refer to the <a
href="#properties" style="border-bottom: 1px solid currentColor;">properties section</a> below for further
details.</p>
<h5 id="separator-syntax">Syntax</h5>
<pre><code class="lang-shell">separator
separator( property = value [property = value [...] ])</code></pre>
<br/>
<h4 id="properties">Properties</h4>
<h5 id="properties-index">Index</h5>
<ul>
<li>
<a href="#property-admin" style="border-bottom: 1px solid currentColor;">Admin</a>
<a href="#property-arguments" style="border-bottom: 1px solid currentColor;">arg</a>
<a href="#property-arguments" style="border-bottom: 1px solid currentColor;">args</a>
<a href="#property-arguments" style="border-bottom: 1px solid currentColor;">Arguments</a>
</li>
<li>
<a href="#property-checked" style="border-bottom: 1px solid currentColor;">Checked</a>
<a href="#property-command" style="border-bottom: 1px solid currentColor;">cmd</a>
<a href="#property-column" style="border-bottom: 1px solid currentColor;">col</a>
<a href="#property-column" style="border-bottom: 1px solid currentColor;">Column</a>
<a href="#property-command" style="border-bottom: 1px solid currentColor;">Command</a>
</li>
<li>
<a href="#property-default" style="border-bottom: 1px solid currentColor;">Default</a>
<a href="#property-directory" style="border-bottom: 1px solid currentColor;">dir</a>
<a href="#property-directory" style="border-bottom: 1px solid currentColor;">Directory</a>
</li>
<li>
<a href="#property-expanded" style="border-bottom: 1px solid currentColor;">Expanded</a>
</li>
<li>
<a href="#property-find" style="border-bottom: 1px solid currentColor;">Find</a>
</li>
<li>
<a href="#property-image" style="border-bottom: 1px solid currentColor;">Icon</a>
<a href="#property-image" style="border-bottom: 1px solid currentColor;">Image</a>
<a href="#property-invoke" style="border-bottom: 1px solid currentColor;">Invoke</a>
</li>
<li>
<a href="#property-keys" style="border-bottom: 1px solid currentColor;">Keys</a>
</li>
<li>
<a href="#property-mode" style="border-bottom: 1px solid currentColor;">Mode</a>
<a href="#property-parent" style="border-bottom: 1px solid currentColor;">Menu</a>
</li>
<li>
<a href="#property-parent" style="border-bottom: 1px solid currentColor;">Parent</a>
<a href="#property-position" style="border-bottom: 1px solid currentColor;">pos</a>
<a href="#property-position" style="border-bottom: 1px solid currentColor;">Position</a>
</li>
<li>
<a href="#property-separator" style="border-bottom: 1px solid currentColor;">sep</a>
<a href="#property-separator" style="border-bottom: 1px solid currentColor;">Separator</a>
</li>
<li>
<a href="#property-tip" style="border-bottom: 1px solid currentColor;">Tip</a>
<a href="#property-title" style="border-bottom: 1px solid currentColor;">Title</a>
<a href="#property-type" style="border-bottom: 1px solid currentColor;">Type</a>
</li>
<li>
<a href="#property-verb" style="border-bottom: 1px solid currentColor;">Verb</a>
<a href="#property-visibility" style="border-bottom: 1px solid currentColor;">vis</a>
<a href="#property-visibility" style="border-bottom: 1px solid currentColor;">Visibility</a>
</li>
<li>
<a href="#property-wait" style="border-bottom: 1px solid currentColor;">Wait</a>
<a href="#property-where" style="border-bottom: 1px solid currentColor;">Where</a>
<a href="#property-window" style="border-bottom: 1px solid currentColor;">Window</a>
</li>
</ul>
<h5 id="properties-syntax">Syntax</h5>
<div class="table-responsive">
<table class="table">
<thead>
<tr>
<th scope="col">Property</th>
<th scope="col">Summary</th>
</tr>
</thead>
<tbody>
<tr id="property-where">
<td>Where</td>
<td>Allow menu item to be passed if a true value is returned<br>
Default = <span class="syntax-keyword">true</span>
</td>
</tr>
<tr id="property-title">
<td>Title</td>
<td>Sets a value indicating the caption of the menuitem.<br/>
<p class="text-danger">For <a href="#menu" style="border-bottom: 1px solid currentColor;"><span
class="is-family-monospace">menu</span></a> and <a href="#menu"
style="border-bottom: 1px solid currentColor;"><span
class="is-family-monospace">item</span></a> entries, this property must be included with if no
<a href="#property-image" style="border-bottom: 1px solid currentColor;"><code>image</code>
property</a> is defined.</p>
Default = <span class="syntax-keyword">null</span>
<p class="syntax-prop">Required for menu, item.</p>
</td>
</tr>
<tr id="property-mode">
<td>Mode</td>
<td>Accept item by selections behavior. Value have one of the following parameters:
<table class="table">
<tr>
<td class="syntax-keyword">none</td>
<td>Accept item when there are no selections.</td>
</tr>
<tr>
<td class="syntax-keyword">single</td>
<td>Accept menuitem when there are single selection.</td>
</tr>
<tr>
<td class="syntax-keyword">multi_unique</td>
<td>Accept when multiple selections are single type.</td>
</tr>
<tr>
<td class="syntax-keyword">multi_single</td>
<td>Accept when multiple selections are single file extension.</td>
</tr>
<tr>
<td class="syntax-keyword">multiple</td>
<td>Accept all types.</td>
</tr>
</table>
Default = <span class="syntax-keyword">single</span>
<p class="syntax-prop">Required for menu, item, separator.</p>
</td>
</tr>
<tr id="property-type">
<td>Type</td>
<td>Specify the types of object files allowed for the menu item to appear. The property is assigned to one
or more of these parameters and this character <code>|</code> is used to separate types.<br/>
Add a character <code>~</code> before single type to exclude.
<p class="has-text-danger">The property not supported syntax expressions.</p>
<table class="table">
<tr id="property-type-asterisks">
<td class="syntax-keyword">*</td>
<td>Accept menuitem when any type are selected.</td>
</tr>
<tr id="property-type-file">
<td class="syntax-keyword">File</td>
<td>Accept menuitem when file are selected.</td>
</tr>
<tr id="property-type-directory">
<td class="syntax-keyword">Directory(Dir)</td>
<td>Accept menuitem when Directory are selected.</td>
</tr>
<tr id="property-type-drive">
<td class="syntax-keyword">Drive</td>
<td>Drive objects</td>
</tr>
<tr id="property-type-usb">
<td class="syntax-keyword">USB</td>
<td>Accept menuitem when USB flash drive are selected.</td>
</tr>
<tr id="property-type-dvd">
<td class="syntax-keyword">DVD</td>
<td>The drive is a DVD-ROM drive</td>
</tr>
<tr id="property-type-fixed">
<td class="syntax-keyword">Fixed</td>
<td>Accept menuitem when Fixed drive are selected. The drive has fixed media; for example, a
hard disk drive or flash drive.
</td>
</tr>
<tr id="property-type-vhd">
<td class="syntax-keyword">VHD</td>
<td>Accept menuitem when Virtual Hard Disk are selected.</td>
</tr>
<tr id="property-type-removable">
<td class="syntax-keyword">Removable</td>
<td>The drive has removable media; for example, a floppy drive, thumb drive, or flash card
reader.
</td>
</tr>
<tr id="property-type-remote">
<td class="syntax-keyword">Remote</td>
<td>The drive is a remote (network) drive.</td>
</tr>
<tr id="property-type-back">
<td class="syntax-keyword">Back</td>
<td>Accept menu item when the background of all types are selected or can specify of this types
for the background (back.directory, back.drive[back.fixed, back.usb, back.dvd, back.vhd,
back.Removable], back.namespace[back.computer, back.recyclebin])
</td>
</tr>
<tr id="property-type-desktop">
<td class="syntax-keyword">Desktop</td>
<td>Accept menuitem when the Desktop are selected.</td>
</tr>
<tr id="property-type-namespace">
<td class="syntax-keyword">Namespace</td>
<td>Accept menuitem when Namespace are selected. Can be virtual objects such as the My Network
Places and Recycle Bin.
</td>
</tr>
<tr id="property-type-computer">
<td class="syntax-keyword">Computer</td>
<td>Accept menuitem when the My Computer are selected.</td>
</tr>
<tr id="property-type-recyclebin">
<td class="syntax-keyword">Recyclebin</td>
<td>Accept menuitem when the Recycle bin are selected.</td>
</tr>
<tr id="property-type-taskbar">
<td class="syntax-keyword">Taskbar</td>
<td>Accept menuitem when the Taskbar are selected.</td>
</tr>
</table>
Default = <span class="syntax-keyword">Accepts all types except for the taskbar.</span>
<p class="syntax-prop">Required for menu, item, separator.</p>
</td>
</tr>
<tr id="property-visibility">
<td>Visibility (vis)</td>
<td>Visibility of menuitem and can have one of the following parameters:
<table class="table">
<tr id="property-visibility-hidden">
<td class="syntax-keyword">Hidden</td>
<td>Them menuitem will not be displayed.</td>
</tr>
<tr id="property-visibility-normal">
<td class="syntax-keyword">Normal</td>
<td>Enabled the menuitem.</td>
</tr>
<tr id="property-visibility-disable">
<td class="syntax-keyword">Disable</td>
<td>Disabled the menuitem.</td>
</tr>
<tr id="property-visibility-static">
<td class="syntax-keyword">Static</td>
<td>Display item as label with/out an image</td>
</tr>
<tr id="property-visibility-label">
<td class="syntax-keyword">Label</td>
<td>Display item as label without an image</td>
</tr>
</table>
Default = <span class="syntax-keyword">Noraml</span>
<p class="syntax-prop">Required for menu, item, separator.</p>
</td>
</tr>
<tr id="property-find">
<td>Find</td>
<td>
<p>Accept menuitem when the specified path name or path extension is contains or equal to the current
find property.<br/>Use this delimiter <code>|</code> to separate patterns.</p>
Default = <span class="syntax-keyword">null</span><br/>
<strong>Syntax</strong><br/>
find = 'exe' Find any word contains "exe"<br/>
find = '"exe"' Match whole word only<br/>
find = '*exe' Find a word that ends with<br/>
find = 'exe*' Find a word that starts with<br/>
<br/>
find = '!exe' Find any word not contains "exe"<br/>
find = '!"exe"' Search for any word not equal to "exe"<br/>
find = '!*exe' Find a word that not ends with<br/>
find = 'exe*!' Find a word that starts with<br/>
<br/>
find = '.exe' Find an equal extension for ".exe"<br/>
find = '!.exe' Find an not equal extension for ".exe"<br/>
<br/>
find = '.exe|.dll' Find an equal extension for ".exe" or ".dll"
</td>
</tr>
<tr id="property-separator">
<td>Separator (sep)</td>
<td>Add separator with menuitem position by parameters:
<table class="table">
<tr id="property-separator-none">
<td class="syntax-keyword">None</td>
<td>Not adding a separator with the menuitem.</td>
</tr>
<tr id="property-separator-before">
<td class="syntax-keyword">Before, Top</td>
<td>Add a separator before the menuitem.</td>
</tr>
<tr id="property-separator-after">
<td class="syntax-keyword">After, Bottom</td>
<td>Add a separator after the menuitem.</td>
</tr>
<tr id="property-separator-both">
<td class="syntax-keyword">Both</td>
<td>Add a separator before and after the menuitem.</td>
</tr>
</table>
Default = <span class="syntax-keyword">none</span>
<p class="syntax-prop">Required for menu, item.</p>
</td>
</tr>
<tr id="property-position">
<td>Position (pos)</td>
<td>The position at which a menuitem should be inserted into the <a href="#menu"
style="border-bottom: 1px solid currentColor;"><span
class="is-family-monospace">menu</span></a>.<br/>Position can have one of the
following parameters:
<table class="table">
<tr id="property-position-auto">
<td class="syntax-keyword">Auto</td>
<td>Insert the menuitem to the current position.</td>
</tr>
<tr id="property-position-middle">
<td class="syntax-keyword">Middle</td>
<td>Insert the menuitem to the middle of the <a href="#menu"
style="border-bottom: 1px solid currentColor;"><span
class="is-family-monospace">menu</span></a>.
</td>
</tr>
<tr id="property-position-top">
<td class="syntax-keyword">Top</td>
<td>Insert the menuitem to the top of the <a href="#menu"
style="border-bottom: 1px solid currentColor;"><span
class="is-family-monospace">menu</span></a>.
</td>
</tr>
<tr id="property-position-bottom">
<td class="syntax-keyword">Bottom</td>
<td>Insert the menuitem to the bottom of the <a href="#menu"
style="border-bottom: 1px solid currentColor;"><span
class="is-family-monospace">menu</span></a>.
</td>
</tr>
<tr id="property-position-integer">
<td class="syntax-keyword">Number sets</td>
<td>Insert the menuitem to a specified position with integer numbers.</td>
</tr>
</table>
Default = <span class="syntax-keyword">auto</span>
<p class="syntax-prop">Required for menu, item, separator.</p>
</td>
</tr>
<tr id="property-image">
<td>Image, Icon</td>
<td>The icon that appears in a menuitem, This property can be assigned as image files, resource icons, glyph
or color. With one of the following parameters
<table class="table">
<tr id="property-image-null">
<td class="syntax-keyword">null</td>
<td>Show menuitem without icon.</td>
</tr>
<tr id="property-image-inherit">
<td class="syntax-keyword">Inherit</td>
<td>@*Inheriting the image from the parent.*@
Inherits this property from its parent element.
</td>
</tr>
<tr id="property-image-cmd">
<td class="syntax-keyword">Cmd</td>
<td>Assign image from the command property.</td>
</tr>
<tr id="property-image-glyph">
<td class="syntax-keyword">Glyph</td>
<td>Assign image as Glyph.</td>
</tr>
<tr id="property-image-color">
<td class="syntax-keyword">Color</td>
<td>Assign image as color.</td>
</tr>
<tr id="property-image-path">
<td class="syntax-keyword">Path</td>
<td>Assign image from location path or resource icon.</td>
</tr>
</table>
Default = <span class="syntax-keyword">null</span>
<p class="syntax-prop">Required for menu, item.</p>
</td>
</tr>
<tr id="property-parent">
<td>Parent, Menu</td>
<td><p>Move current item to another menu.</p>
Default = <span class="syntax-keyword">null</span></td>
</tr>
<tr id="property-command">
<td>Command (cmd)</td>
<td><p>The command associated with the menuitem. Occurs when the menuitem is clicked or selected using a
shortcut key or access key defined for the menuitem.</p>
Default = <span class="syntax-keyword">null</span>
<p class="syntax-prop">Required for item.</p>
</td>
</tr>
<tr id="property-arguments">
<td>Arguments (arg, args)</td>
<td><p>The parameter to pass to the Command property of a menuitem.</p>
Default = <span class="syntax-keyword">null</span>
<p class="syntax-prop">Required for item.</p>
</td>
</tr>
<tr id="property-invoke">
<td>Invoke</td>
<td>Set execution type
<table class="table">
<tr id="property-invoke-single">
<td class="syntax-keyword">0, single</td>
<td>execute the command for each file selected</td>
</tr>
<tr id="property-invoke-multiple">
<td class="syntax-keyword">1, multiple</td>
<td>execute the command in one process</td>
</tr>
</table>
Default = <span class="syntax-keyword">0</span>
<p class="syntax-prop">Required for item.</p>
</td>
</tr>
<tr id="property-window">
<td>Window</td>
<td>Controls how the window is to be shown. can be one of the following parameters:
<p class="syntax-keyword">Hidden, Show, Visible, Minimized, Maximized</p>
Default = <span class="syntax-keyword">show</span>
<p class="syntax-prop">Required for item.</p>
</td>
</tr>
<tr id="property-directory">
<td>Directory (dir)</td>
<td><p>Specify the work directory to execute the command.</p>
Default = <span class="syntax-keyword">null</span>
<p class="syntax-prop">Required for item.</p></td>
</tr>
<tr id="property-admin">
<td>Admin</td>
<td><p>Execute the command with administrative permissions.</p>
Default = <span class="syntax-keyword">false</span>
<p class="syntax-prop">Required for item.</p>
</td>
</tr>
<tr id="property-verb">
<td>Verb</td>
<td>Specifies that the operation is the default for the selected file. value type string and can have one of
the following parameters:<br/>
<table class="table">
<tr id="property-verb-null">
<td>null</td>
<td>Specifies that the operation is the default for the selected file type.</td>
</tr>
<tr id="property-verb-open">
<td>Open</td>
<td>Opens a file or a application.</td>
</tr>
<tr id="property-verb-openas">
<td>OpenAs</td>
<td>Opener dialog when no program is associated to the extension.</td>
</tr>
<tr id="property-verb-runas">
<td>RunAs</td>
<td>In Windows 7 and Vista, opens the UAC dialog andin others, open the Run as... Dialog.</td>
</tr>
<tr id="property-verb-edit">
<td>Edit</td>
<td>Opens the default text editor for the file.</td>
</tr>
<tr id="property-verb-explore">
<td>Explore</td>
<td>Opens the Windows Explorer in the folder specified in Directory.</td>
</tr>
<tr id="property-verb-properties">
<td>Properties</td>
<td>Opens the properties window of the file.</td>
</tr>
<tr id="property-verb-print">
<td>Print</td>
<td>Start printing the file with the default application.</td>
</tr>
<tr id="property-verb-find">
<td>Find</td>
<td>Start a search.</td>
</tr>
</table>
Default = <span class="syntax-keyword">open</span>
<p class="syntax-prop">Required for item.</p>
</td>
</tr>
<tr id="property-wait">
<td>Wait</td>
<td>
<p>Waiting Until end of command.</p>
Default = <span class="syntax-keyword">false</span>
<p class="syntax-prop">Required for item.</p>
</td>
</tr>
<tr id="property-checked">
<td>Checked</td>
<td>Value that indicates whether the menuitem checked type:
<table class="table">
<tr id="property-checked-0">
<td class="syntax-keyword">0</td>
<td>Not checked</td>
</tr>
<tr id="property-checked-1">
<td class="syntax-keyword">1</td>
<td>Display as checked mark.</td>
</tr>
<tr id="property-checked-2">
<td class="syntax-keyword">2</td>
<td>Display as radio bullet.</td>
</tr>
</table>
Default = <span class="syntax-keyword">0</span>
<p class="syntax-prop">Required for item.</p>
</td>
</tr>
<tr id="property-default">
<td>Default</td>
<td>
<p>Specifies that the menuitem is the default. A <a href="#menu"
style="border-bottom: 1px solid currentColor;"><span
class="is-family-monospace">menu</span></a> can contain only one default menuitem, which is
displayed in bold.</p>
Default = <span class="syntax-keyword">false</span>
<p class="syntax-prop">Required for item.</p>
</td>
</tr>
<tr id="property-expanded">
<td>Expanded</td>
<td>
<p>Move items to the parent <a href="#menu" style="border-bottom: 1px solid currentColor;"><span
class="is-family-monospace">menu</span></a>.</p>
Default = <span class="syntax-keyword">false</span>
<p class="syntax-prop">Required for menu.</p>
</td>
</tr>
<tr id="property-column">
<td>Column(col)</td>
<td><p>Create a new column.</p>
Default = <span class="syntax-keyword">true</span>
<p class="syntax-prop">Required for item, menu.</p>
</tr>
<tr id="property-keys">
<td>Keys</td>
<td><p>Show keyboard shortcuts.</p>
Default = <span class="syntax-keyword">null</span></td>
</tr>
<tr id="property-tip">
<td>Tip</td>
<td>
<p>Show a tip for the current <a href="#menu" style="border-bottom: 1px solid currentColor;"><span
class="is-family-monospace">menu</span></a> or <a href="#item"
style="border-bottom: 1px solid currentColor;"><span class="is-family-monospace">item</span></a>.
</p>
Default = <span class="syntax-keyword">null</span><br/>
<strong>Syntax</strong><br/>
<pre><code class="lang-shell">
tip = "Lorem Ipsum is simply dummy text."
tip = ["Lorem Ipsum is simply dummy text.", tip.info]
tip = ["Lorem Ipsum is simply dummy text.", tip.info, 1.2]
</code></pre>
</td>
</tr>
</tbody>
</table>
</div>