# DOpusFactory

The **DOpusFactory** object is a helper object that you can use to create various other objects. Unlike the objects that represent existing _things_ (e.g. [**Lister**](lister) or [**Tab**](tab)), the objects created by **DOpusFactory** are independent objects that you can instantiate whenever you need their functionality. The **DOpusFactory** object is obtained via the [**DOpus**](dopus)**.Create** method.

<table data-header-hidden><thead><tr><th></th><th></th><th></th><th></th></tr></thead><tbody><tr><td>Method Name</td><td><strong>Arguments</strong></td><td>Return Type</td><td>Description</td></tr><tr><td>Blob</td><td><em>none</em><br>or &#x3C;int:size><br>or &#x3C;byte, byte, ...><br>or &#x3C;<a href="blob"><strong>Blob</strong></a>:source></td><td><em>object:</em><a href="blob"><strong>Blob</strong></a></td><td><p>Returns a new <a href="blob"><strong>Blob</strong></a> object, that lets you access and manipulate a chunk of binary data from a script. If no parameters are given the new <strong>Blob</strong> will be empty - you can set its size using the <strong>resize</strong> method - otherwise you can specify the initial size as a parameter.</p><p>You can also create a <strong>Blob</strong> pre-filled with data by specifying the actual byte values (e.g. <em>Blob(72,69,76,76,79)</em>).</p><p>If another <strong>Blob</strong> (or an array - see the documentation on the <strong>Blob</strong> object for a discussion of this) is given then the new <strong>Blob</strong> will be created as a copy of the existing one.</p></td></tr><tr><td>BusyIndicator</td><td><em>none</em></td><td><em>object:</em><a href="busyindicator"><strong>BusyIndicator</strong></a></td><td>Creates a new <a href="busyindicator"><strong>BusyIndicator</strong></a> object, that lets you control the breadcrumbs bar busy indicator from your script.</td></tr><tr><td>Command</td><td><em>none</em></td><td><em>object:</em><a href="command"><strong>Command</strong></a></td><td>Creates a new <a href="command"><strong>Command</strong></a> object, that lets you run Opus commands from a script.</td></tr><tr><td>Date</td><td><em>none</em><br>or &#x3C;variant:date><br>or <em>JScript Date</em></td><td><em>object</em>:<a href="date"><strong>Date</strong></a></td><td><p>Creates a new <a href="date"><strong>Date</strong></a> object. If a date value is provided the new object will be initialized to that value, otherwise the date will be set to the current local time. The provided value can be one of the following:</p><ul><li>Another <strong>Date</strong> object</li><li>A string in the form "yyyymmdd"</li><li>A string in the form "yyyy-mm-dd hh:mm:ss.mmm" (or part thereof)</li><li>A JScript <strong>Date</strong> object</li><li>A unix epoch time value (seconds since 1/1/1970).</li></ul></td></tr><tr><td>Filter</td><td><em>none</em><br>or &#x3C;string></td><td><em>object:</em><a href="filter"><strong>Filter</strong></a></td><td>Creates a new <a href="filter"><strong>Filter</strong></a> object, which lets you control recursive filtering when running commands from scripts. You can optionally provide a <a href="../../../file_operations/filtered_operations/textual_filters">textual filter</a> string to initialise the filter with. Check the <strong>valid</strong> property of the new <strong>Filter</strong> object to find out whether this string was parsed successfully or not.</td></tr><tr><td>Map</td><td><em>none</em><br>or &#x3C;variant:key>,<br>&#x3C;variant:value>...</td><td><em>object</em>:<a href="map"><strong>Map</strong></a></td><td><p>Creates a new <a href="map"><strong>Map</strong></a> object. If no arguments are provided, the <strong>Map</strong> will be empty. Otherwise, the <strong>Map</strong> will be pre-initialized with the supplied key/value pairs.</p><p>//For <a href="example://">example://</a></p><pre><code>Map("firstname","fred","lastname","bloggs");
</code></pre><p>The individual keys and values can be different types.</p></td></tr><tr><td>OrderedMap</td><td><em>none</em><br>or &#x3C;variant:key>,<br>&#x3C;variant:value>...</td><td><em>object</em>:<a href="orderedmap"><strong>OrderedMap</strong></a></td><td>Creates a new <a href="orderedmap"><strong>OrderedMap</strong></a> object. This is identical to the <a href="https://github.com/Chaoses-Ib/DirectoryOpus/blob/main/Manual/reference/scripting_reference/scripting_objects/Map.md">Map</a> object except that the order of items added to the map is preserved rather than being sorted alphabetically.</td></tr><tr><td>StringSet</td><td><em>none</em><br>or &#x3C;string>, ...</td><td><em>object</em>:<a href="stringset"><strong>StringSet</strong></a></td><td><p>Creates a new case-sensitive <a href="stringset"><strong>StringSet</strong></a> object. If no arguments are provided, the <strong>StringSet</strong> will be empty. Otherwise it will be pre-initialized with the supplied strings; for example:</p><pre><code>StringSet("dog","cat","pony");
</code></pre><p>You can also pass an array of strings or <a href="vector"><strong>Vector</strong></a> object to initialise the set.</p></td></tr><tr><td>StringSetI</td><td><em>none</em><br>or &#x3C;string>, ...</td><td><em>object</em>:<a href="stringset"><strong>StringSet</strong></a></td><td>Creates a new case-insensitive <a href="stringset"><strong>StringSet</strong></a> object. If no arguments are provided, the <strong>StringSet</strong> will be empty. Otherwise it will be pre-initialized with the supplied strings.</td></tr><tr><td>StringTools</td><td><em>none</em></td><td><em>object</em>:<a href="stringtools"><strong>StringTools</strong></a></td><td>Creates a new <a href="stringtools"><strong>StringTools</strong></a> object, that provides helper functions for string encoding and decoding.</td></tr><tr><td>UnorderedSet</td><td><em>none</em><br>or <em>variants</em>...</td><td>object:<a href="unorderedset"><strong>UnorderedSet</strong></a></td><td><p>Creates a new <a href="unorderedset"><strong>UnorderedSet</strong></a> object. If no arguments are provided the <strong>UnorderedSet</strong> will be empty. Otherwise it will be pre-initialized with the supplied elements.</p><p>You can also pass an array or <a href="vector"><strong>Vector</strong></a> to initialise the set.</p></td></tr><tr><td>Vector</td><td><em>none</em><br>or &#x3C;int:elements><br>or <em>variants...</em><br>or <em>object:</em><a href="vector"><strong>vector</strong></a><br>or <em>JScript Array</em></td><td><em>object:</em><a href="vector"><strong>Vector</strong></a></td><td><p>Creates a new <a href="vector"><strong>Vector</strong></a> object.</p><p>If no arguments are provided, the <strong>Vector</strong> will be empty.</p><p>If a single integer argument is provided, the <strong>Vector</strong> will be pre-initialized to that number of elements.</p><p>You can also pass another <a href="vector"><strong>Vector</strong></a> or a <em>JScript</em> array, or most enumerable objects, as the argument to initialise the new <strong>Vector</strong> with the contents of an existing collection.</p><p>If more than one argument is provided, the <strong>Vector</strong> will be pre-initialized with those elements; for example:</p><pre><code>Vector("dog","cat","horse");
</code></pre><p>The individual elements can be different types.</p><p>If you want to create a <strong>Vector</strong> with just a single element, it is best to create an empty <strong>Vector</strong> and then add the element as a second step. Passing a single element during creation can have unexpected results, as it may be interpreted as one of the other cases. (Many of the scripting objects can be implicitly converted into integers or collections.)</p></td></tr></tbody></table>
