<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE dictionary SYSTEM "file://localhost/System/Library/DTDs/sdef.dtd">

<!-- Note: If I get validation errors that make no sense, make sure there are no extra spaces after end tags, like after "</suite>"! -->

<dictionary xmlns:xi="http://www.w3.org/2003/XInclude" title="Find Any File Terminology">

	<!--
		As recommended by Apple since OSX 10.5: Use include from local system instead of including the standard suite here.
		See https://developer.apple.com/library/archive/samplecode/SimpleScripting/Listings/ReadMe_txt.html
		However, I then get the error in log:
			".sdef warning for argument 'FileType' of command 'save' in suite 'Standard Suite': 'saveable file format' is not a valid type name.",
		but it seems I can ignore that.
		Worse, though, is that Script Debugger sees the "document" elements, and when it shows them, and if they are of different type, SD may mess up their properties,
			see https://forum.latenightsw.com/t/how-to-declare-window-subclasses-in-sdef/4331/11?u=tempelmann
		For that reason, and since it's unlikely for Apple to extend AS any further, I use a hard-coded std suite here
	<xi:include href="file:///System/Library/ScriptingDefinitions/CocoaStandard.sdef" xpointer="xpointer(/dictionary/suite)"/>
	-->

	<suite name="Standard Suite" code="????" description="Common classes and commands for all applications.">

		<command name="open" code="aevtodoc" description="Open a document.">
			<direct-parameter description="The file(s) to be opened.">
				<type type="file"/>
				<type type="file" list="yes"/>
			</direct-parameter>
			<result description="The opened document(s).">
				<type type="document"/>
				<type type="document" list="yes"/>
			</result>
		</command>

		<enumeration name="save options" code="savo">
			<enumerator name="yes" code="yes " description="Save the file."/>
			<enumerator name="no" code="no  " description="Do not save the file."/>
			<enumerator name="ask" code="ask " description="Ask the user whether or not to save the file."/>
		</enumeration>

		<command name="close" code="coreclos" description="Close a document.">
			<cocoa class="NSCloseCommand"/>
			<access-group identifier="*"/>
			<direct-parameter type="specifier" requires-access="r" description="the document(s) or window(s) to close."/>
			<parameter name="saving" code="savo" type="save options" optional="yes" description="Should changes be saved before closing?">
				<cocoa key="SaveOptions"/>
			</parameter>
			<parameter name="saving in" code="kfil" type="file" optional="yes" description="The file in which to save the document, if so.">
				<cocoa key="File"/>
			</parameter>
		</command>

		<command name="save" code="coresave" description="Save a document.">
			<access-group identifier="*"/>
			<direct-parameter type="specifier" requires-access="r" description="The document(s) or window(s) to save."/>
			<parameter name="in" code="kfil" type="file" optional="yes" description="The file in which to save the document.">
				<cocoa key="File"/>
			</parameter>
			<!-- this causes a warning:
			<parameter name="as" code="fltp" type="saveable file format" optional="yes" description="The file format to use.">
				<cocoa key="FileType"/>
			</parameter>
			-->
		</command>

		<enumeration name="printing error handling" code="enum">
			<enumerator name="standard" code="lwst" description="Standard PostScript error handling">
				<cocoa boolean-value="NO"/>
			</enumerator>
			<enumerator name="detailed" code="lwdt" description="print a detailed report of PostScript errors">
				<cocoa boolean-value="YES"/>
			</enumerator>
		</enumeration>

		<record-type name="print settings" code="pset">
			<property name="copies" code="lwcp" type="integer" description="the number of copies of a document to be printed">
				<cocoa key="NSCopies"/>
			</property>
			<property name="collating" code="lwcl" type="boolean" description="Should printed copies be collated?">
				<cocoa key="NSMustCollate"/>
			</property>
			<property name="starting page" code="lwfp" type="integer" description="the first page of the document to be printed">
				<cocoa key="NSFirstPage"/>
			</property>
			<property name="ending page" code="lwlp" type="integer" description="the last page of the document to be printed">
				<cocoa key="NSLastPage"/>
			</property>
			<property name="pages across" code="lwla" type="integer" description="number of logical pages laid across a physical page">
				<cocoa key="NSPagesAcross"/>
			</property>
			<property name="pages down" code="lwld" type="integer" description="number of logical pages laid out down a physical page">
				<cocoa key="NSPagesDown"/>
			</property>
			<property name="requested print time" code="lwqt" type="date" description="the time at which the desktop printer should print the document">
				<cocoa key="NSPrintTime"/>
			</property>
			<property name="error handling" code="lweh" type="printing error handling" description="how errors are handled">
				<cocoa key="NSDetailedErrorReporting"/>
			</property>
			<property name="fax number" code="faxn" type="text" description="for fax number">
				<cocoa key="NSFaxNumber"/>
			</property>
			<property name="target printer" code="trpr" type="text" description="for target printer">
				<cocoa key="NSPrinterName"/>
			</property>
		</record-type>

		<command name="print" code="aevtpdoc" description="Print a document.">
			<direct-parameter description="The file(s), document(s), or window(s) to be printed.">
				<type type="file" list="yes"/>
				<type type="specifier"/>
			</direct-parameter>
			<parameter name="with properties" code="prdt" type="print settings" optional="yes" description="The print settings to use.">
				<cocoa key="PrintSettings"/>
			</parameter>
			<parameter name="print dialog" code="pdlg" type="boolean" optional="yes" description="Should the application show the print dialog?">
				<cocoa key="ShowPrintDialog"/>
			</parameter>
		</command>

		<command name="quit" code="aevtquit" description="Quit the application.">
			<cocoa class="NSQuitCommand"/>
			<parameter name="saving" code="savo" type="save options" optional="yes" description="Should changes be saved before quitting?">
				<cocoa key="SaveOptions"/>
			</parameter>
		</command>

		<command name="count" code="corecnte" description="Return the number of elements of a particular class within an object.">
			<cocoa class="NSCountCommand"/>
			<access-group identifier="*"/>
			<direct-parameter type="specifier" requires-access="r" description="The objects to be counted."/>
			<parameter name="each" code="kocl" type="type" optional="yes" description="The class of objects to be counted." hidden="yes">
				<cocoa key="ObjectClass"/>
			</parameter>
			<result type="integer" description="The count."/>
		</command>

		<command name="delete" code="coredelo" description="Delete an object.">
			<cocoa class="NSDeleteCommand"/>
			<access-group identifier="*"/>
			<direct-parameter type="specifier" description="The object(s) to delete."/>
		</command>

		<command name="duplicate" code="coreclon" description="Copy an object.">
			<cocoa class="NSCloneCommand"/>
			<access-group identifier="*"/>
			<direct-parameter type="specifier" requires-access="r" description="The object(s) to copy."/>
			<parameter name="to" code="insh" type="location specifier" description="The location for the new copy or copies." optional="yes">
				<cocoa key="ToLocation"/>
			</parameter>
			<parameter name="with properties" code="prdt" type="record" description="Properties to set in the new copy or copies right away." optional="yes">
				<cocoa key="WithProperties"/>
			</parameter>
		</command>

		<command name="exists" code="coredoex" description="Verify that an object exists.">
			<cocoa class="NSExistsCommand"/>
			<access-group identifier="*"/>
			<direct-parameter type="any" requires-access="r" description="The object(s) to check."/>
			<result type="boolean" description="Did the object(s) exist?"/>
		</command>

		<command name="make" code="corecrel" description="Create a new object.">
			<cocoa class="NSCreateCommand"/>
			<access-group identifier="*"/>
			<parameter name="new" code="kocl" type="type" description="The class of the new object.">
				<cocoa key="ObjectClass"/>
			</parameter>
			<parameter name="at" code="insh" type="location specifier" optional="yes" description="The location at which to insert the object.">
				<cocoa key="Location"/>
			</parameter>
			<parameter name="with data" code="data" type="any" optional="yes" description="The initial contents of the object.">
				<cocoa key="ObjectData"/>
			</parameter>
			<parameter name="with properties" code="prdt" type="record" optional="yes" description="The initial values for properties of the object.">
				<cocoa key="KeyDictionary"/>
			</parameter>
			<result type="specifier" description="The new object."/>
		</command>

		<command name="move" code="coremove" description="Move an object to a new location.">
			<cocoa class="NSMoveCommand"/>
			<access-group identifier="*"/>
			<direct-parameter type="specifier" requires-access="r" description="The object(s) to move."/>
			<parameter name="to" code="insh" type="location specifier" description="The new location for the object(s).">
				<cocoa key="ToLocation"/>
			</parameter>
		</command>

		<class name="application" code="capp" description="The application's top-level scripting object.">
			<cocoa class="NSApplication"/>
			<property name="name" code="pnam" type="text" access="r" description="The name of the application."/>
			<property name="frontmost" code="pisf" type="boolean" access="r" description="Is this the active application?">
				<cocoa key="isActive"/>
			</property>
			<property name="version" code="vers" type="text" access="r" description="The version number of the application."/>
			<element type="document" hidden="yes">
				<cocoa key="orderedDocuments"/>
			</element>
			<element type="window" access="r">
				<cocoa key="orderedWindows"/>
			</element>
			<responds-to command="open">
				<cocoa method="handleOpenScriptCommand:"/>
			</responds-to>
			<responds-to command="print">
				<cocoa method="handlePrintScriptCommand:"/>
			</responds-to>
			<responds-to command="quit">
				<cocoa method="handleQuitScriptCommand:"/>
			</responds-to>
		</class>

		<class name="document" code="docu" description="A document.">
			<cocoa class="NSDocument"/>
			<property name="name" code="pnam" type="text" access="r" description="Its name.">
				<cocoa key="displayName"/>
			</property>
			<property name="modified" code="imod" type="boolean" access="r" description="Has it been modified since the last save?">
				<cocoa key="isDocumentEdited"/>
			</property>
			<property name="file" code="file" type="file" access="r" description="Its location on disk, if it has one.">
				<cocoa key="fileURL"/>
			</property>
			<responds-to command="close">
				<cocoa method="handleCloseScriptCommand:"/>
			</responds-to>
			<responds-to command="print">
				<cocoa method="handlePrintScriptCommand:"/>
			</responds-to>
			<responds-to command="save">
				<cocoa method="handleSaveScriptCommand:"/>
			</responds-to>
		</class>

		<class name="window" code="cwin" description="A window.">
			<cocoa class="NSWindow"/>
			<property name="name" code="pnam" type="text" access="r" description="The title of the window.">
				<cocoa key="title"/>
			</property>
			<property name="id" code="ID  " type="integer" access="r" description="The unique identifier of the window.">
				<cocoa key="uniqueID"/>
			</property>
			<property name="index" code="pidx" type="integer" description="The index of the window, ordered front to back.">
				<cocoa key="orderedIndex"/>
			</property>
			<property name="bounds" code="pbnd" type="rectangle" description="The bounding rectangle of the window.">
				<cocoa key="boundsAsQDRect"/>
			</property>
			<property name="closeable" code="hclb" type="boolean" access="r" description="Does the window have a close button?">
				<cocoa key="hasCloseBox"/>
			</property>
			<property name="miniaturizable" code="ismn" type="boolean" access="r" description="Does the window have a minimize button?">
				<cocoa key="isMiniaturizable"/>
			</property>
			<property name="miniaturized" code="pmnd" type="boolean" description="Is the window minimized right now?">
				<cocoa key="isMiniaturized"/>
			</property>
			<property name="resizable" code="prsz" type="boolean" access="r" description="Can the window be resized?">
				<cocoa key="isResizable"/>
			</property>
			<property name="visible" code="pvis" type="boolean" description="Is the window visible right now?">
				<cocoa key="isVisible"/>
			</property>
			<property name="zoomable" code="iszm" type="boolean" access="r" description="Does the window have a zoom button?">
				<cocoa key="isZoomable"/>
			</property>
			<property name="zoomed" code="pzum" type="boolean" description="Is the window zoomed right now?">
				<cocoa key="isZoomed"/>
			</property>
			<property name="document" code="docu" type="document" access="r" description="The document whose contents are displayed in the window." hidden="yes">
				<!-- hidden by default, because some FAF window types, e.g. About, don't use a document, and so it's pointless to have them show up with "missing value" in Explorer -->
			</property>
			<responds-to command="close">
				<cocoa method="handleCloseScriptCommand:"/>
			</responds-to>
			<responds-to command="print">
				<cocoa method="handlePrintScriptCommand:"/>
			</responds-to>
			<responds-to command="save">
				<cocoa method="handleSaveScriptCommand:"/>
			</responds-to>
		</class>

	</suite>

	<suite name="Find Any File Suite" code="FAFs" description="Find Any File-specific classes.">

		<class name="application" code="capp" inherits="application" description="The application's top-level scripting object.">
			<cocoa class="Application"/>
			<property name="support folder" code="Fld?" description="FAF's Application Support folder containing the log file, scripts etc. (i.e. ~/Application Support/Find Any File)" type="file" access="r">
				<cocoa key="appSupportFolder"/>
			</property>
			<element type="search window" access="r">
				<cocoa key="orderedSearchWindows"/>
			</element>
			<element type="result window" access="r">
				<cocoa key="orderedResultWindows"/>
			</element>
			<element type="result set" access="r" hidden="yes">
				<cocoa key="scriptedResultSets"/>
			</element>
			<element type="disk item" access="r" hidden="yes">
				<cocoa key="scriptedDiskItems"/>
				<!-- should not be looked up by name (to make that work, I'd have to set its 'pnam' to the canonical path) -->
				<accessor style="index"/>
				<accessor style="id"/>
			</element>
			<element type="rule set" access="r" hidden="yes">
				<cocoa key="allSearchSpecs"/>
			</element>
			<element type="search domain" access="r" hidden="yes">
				<cocoa key="allSearchDomains"/>
			</element>
			<element type="search operation" access="r" hidden="yes">
				<cocoa key="scriptedSearches"/>
			</element>
			<element type="result item" access="r" description="Returns all known result items, including the unmatched ones." hidden="yes">
				<cocoa key="scriptedResultItems"/>
			</element>
		</class>

		<command name="start search" code="FAF2Find" description="Starts a search (does nothing if a search is already in progress).">
			<direct-parameter type="specifier" description="The find window to start the search in."/>
			<result type="search operation" description="The search operation."/>
		</command>

		<command name="stop search" code="FAF2Stop" description="Stops a search in progress.">
			<direct-parameter type="specifier" description="The search operation returned from the 'start search' command or the window that initiated the search."/>
			<parameter name="showing results" code="StSR" type="boolean" optional="yes" description="Shall the already gathered results be shown in a window?">
				<cocoa key="showResults"/>
			</parameter>
		</command>
		
		<class name="search window" code="Swin" description="A window showing the search rules." inherits="window">
			<cocoa class="SearchWindow"/>
			<property name="search rules" code="Sset" type="rule set" access="r" description="The rules for this search.">
				<cocoa key="scriptedSearchSpecs"/>
			</property>
			<property name="ready for new search" code="Srdy" type="boolean" access="r" description="Is true when a new search is ready to be started, and becomes false after a search was performed. If the rules or search locations get modified, this becomes true again.">
				<cocoa key="scriptedReadyForNewSearch"/>
			</property>
			<!-- note: If I ever make a mixed window with both the search and results in it, then "document" will still be the ".faf" file,
					whereas "result document" refers to the .paths file that can be exported into.
					But the primary doc is always identifying the search, not the results. -->
			<property name="document" code="docu" type="document" access="r" description="The document for the search." hidden="no">
			</property>
			<property name="result window" code="STwn" type="result window" access="r" description="The window the results will be or are appearing in. May be 'missing value'.">
				<cocoa key="scriptedTargetWindow"/>
			</property>
			<responds-to command="start search">
				<cocoa method="handleStartSearch:"/>
			</responds-to>
			<responds-to command="stop search">
				<cocoa method="handleStopSearch:"/>
			</responds-to>
		</class>

		<class name="search operation" code="SrOp" description="A search in progress that can be stopped, producing results. Transient, i.e. it effectively vanishes once the search operation has finished." inherits="item">
			<cocoa class="Search"/>
			<property name="id" code="ID  " type="integer" access="r" description="Its unique identifier.">
				<cocoa key="uniqueID"/>
			</property>
			<property name="search rules" code="Sset" type="rule set" access="r" description="The rules for this search.">
				<cocoa key="scriptedSearchSpecs"/>
			</property>
			<property name="result" code="Resu" type="result set" access="r" description="The results gathered by the search.">
				<cocoa key="scriptedResult"/>
			</property>
			<responds-to command="stop search">
				<cocoa method="handleStopSearch:"/>
			</responds-to>
		</class>

		<class name="result window" code="Rwin" description="A window showing results." inherits="window">
			<cocoa class="ResultWindow"/>
			<property name="result" code="Resu" type="result set" access="r" description="The files and folders shown by this window.">
				<cocoa key="scriptedResult"/>
			</property>
			<property name="result document" code="RsDc" type="document" access="r" description="The document for the result. Since it's planned to allow both the search and the results in the same window, it's possible to use this property for accessing the result, e.g. when loaded from a '.paths' file.">
				<cocoa key="document"/>
			</property>
			<property name="search window" code="RSwn" type="search window" access="r" description="The window that started the search for the shown results. May be 'missing value'.">
				<cocoa key="scriptedSearchWindow"/>
			</property>
			<property name="finished loading" code="FinL" type="boolean" access="r" description="Use this to check whether the window has loaded all result items (as it loads them asynchronously, this may take a while even after the search is completed and the results have all be gathered).">
				<cocoa key="finishedLoading"/>
			</property>
		</class>

		<!-- https://stackoverflow.com/a/37327603
		<record-type  name="raw search spec record" code="SSRc">
			<property name="subj" code="SSR1" type="integer"
				description="The short title, created from the rules."
			/>
			<property name="verb" code="SSR2" type="integer"
				description="The short title, created from the rules."
			/>
			<property name="val" code="SSR3" type="text"
				description="The short title, created from the rules."
			/>
		</record-type>
		<record-type  name="raw search set record" code="SRec">
			<property name="title" code="SRti" type="text"
				description="The short title, created from the rules."
			/>
			<property name="autoStart" code="SRas" type="boolean"
				description="Whether to run this search when opening it in FAF."
			/>
			<property name="savedBy" code="SRsb" type="integer"
				description="Build number of FAF that created this search set."
			/>
			<property name="sources" code="SRso" type="text"
				description="The locations (paths) in which to search."
			/>
			<property name="specs" code="SRsp" type="raw search spec record"
				description="The search rules"
			/>
		</record-type>
		-->

		<enumeration name="search nouns" code="Noun" description="Nouns for rules">
			<enumerator name="full name" code="No00" description="Full file name (including extension)">
				<cocoa integer-value="0"/>
			</enumerator>
			<enumerator name="filetype code" code="No01" description="FileType code">
				<cocoa integer-value="1"/>
			</enumerator>
			<enumerator name="creator code" code="No02" description="Creator code">
				<cocoa integer-value="2"/>
			</enumerator>
			<enumerator name="creation date" code="No03" description="Creation date">
				<cocoa integer-value="3"/>
			</enumerator>
			<enumerator name="modification date" code="No04" description="Modification date">
				<cocoa integer-value="4"/>
			</enumerator>
			<enumerator name="label" code="No05" description="Label">
				<cocoa integer-value="5"/>
			</enumerator>
			<enumerator name="file size" code="No06" description="File size">
				<cocoa integer-value="6"/>
			</enumerator>
			<enumerator name="kind" code="No07" description="Kind">
				<cocoa integer-value="7"/>
			</enumerator>
			<enumerator name="is a directory" code="No08" description="Is A Directory">
				<cocoa integer-value="8"/>
			</enumerator>
			<enumerator name="is an alias" code="No09" description="Is An Alias">
				<cocoa integer-value="9"/>
			</enumerator>
			<enumerator name="owner id" code="No10" description="BSD owner ID">
				<cocoa integer-value="10"/>
			</enumerator>
			<enumerator name="group id" code="No11" description="BSD group ID">
				<cocoa integer-value="11"/>
			</enumerator>
			<enumerator name="negate all" code="No12" description="Negate all conditions">
				<cocoa integer-value="12"/>
			</enumerator>
			<enumerator name="case sensitive names" code="No13" description="Case sensitive names">
				<cocoa integer-value="13"/>
			</enumerator>
			<enumerator name="package contents" code="No14" description="Package contents">
				<cocoa integer-value="14"/>
			</enumerator>
			<enumerator name="invisible items" code="No15" description="Invisible items">
				<cocoa integer-value="15"/>
			</enumerator>
			<enumerator name="trashed contents" code="No16" description="Trashed contents">
				<cocoa integer-value="16"/>
			</enumerator>
			<enumerator name="limit amount" code="No17" description="Limit results">
				<cocoa integer-value="17"/>
			</enumerator>
			<enumerator name="pass results" code="No18" description="Pass results to file or app">
				<cocoa integer-value="18"/>
			</enumerator>
			<enumerator name="Limit dolder depth" code="No20" description="Limit folder depth">
				<cocoa integer-value="20"/>
			</enumerator>
			<enumerator name="resourcefork size" code="No21" description="Resource fork size">
				<cocoa integer-value="21"/>
			</enumerator>
			<enumerator name="path" code="No22" description="Path">
				<cocoa integer-value="22"/>
			</enumerator>
			<enumerator name="folder names" code="No23" description="Folder names">
				<cocoa integer-value="23"/>
			</enumerator>
			<enumerator name="file content" code="No24" description="File (text) content">
				<cocoa integer-value="24"/>
			</enumerator>
			<enumerator name="case sensitive content" code="No25" description="Case sensitive content">
				<cocoa integer-value="25"/>
			</enumerator>
			<enumerator name="UTI" code="No26" description="UTI (Uniform Type Identifier)">
				<cocoa integer-value="26"/>
			</enumerator>
			<enumerator name="forced slow" code="No27" description="Force slow search (not CatSearch)">
				<cocoa integer-value="27"/>
			</enumerator>
			<enumerator name="last content access date" code="No28" description="Last content access date">
				<cocoa integer-value="28"/>
			</enumerator>
			<enumerator name="added to dir date" code="No29" description="Added to dir date">
				<cocoa integer-value="29"/>
			</enumerator>
			<enumerator name="tags" code="No30" description="Tags">
				<cocoa integer-value="30"/>
			</enumerator>
			<enumerator name="inode" code="No31" description="Inode number">
				<cocoa integer-value="31"/>
			</enumerator>
			<enumerator name="diacritics sensitive names" code="No32" description="Diacritics sensitive names">
				<cocoa integer-value="32"/>
			</enumerator>
			<enumerator name="script" code="No33" description="Script">
				<cocoa integer-value="33"/>
			</enumerator>
			<enumerator name="extension" code="No34" description="File name extension">
				<cocoa integer-value="34"/>
			</enumerator>
			<enumerator name="comments" code="No35" description="Comments">
				<cocoa integer-value="35"/>
			</enumerator>
			<enumerator name="is dataless" code="No36" description="Is dataless (in cloud only)">
				<cocoa integer-value="36"/>
			</enumerator>
			<enumerator name="spotlight mode" code="No37" description="Spotlight mode">
				<cocoa integer-value="37"/>
			</enumerator>
			<enumerator name="link count" code="No38" description="Hardlink count">
				<cocoa integer-value="38"/>
			</enumerator>
			<enumerator name="name without extension" code="No39" description="File name without extension">
				<cocoa integer-value="39"/>
			</enumerator>
			<enumerator name="use find tool" code="No40" description="Use find tool (Pro option)">
				<cocoa integer-value="40"/>
			</enumerator>
			<enumerator name="calculate all dir sizes" code="No41" description="Calculate all folder sizes?">
				<cocoa integer-value="41"/>
			</enumerator>
		</enumeration>

		<enumeration name="search types" code="STyp" description="Rule types.">
			<enumerator name="textual" code="Ttex" description="Textual">
				<cocoa integer-value="0"/>
			</enumerator>
			<enumerator name="size" code="Tsit" description="File size">
				<cocoa integer-value="1"/>
			</enumerator>
			<enumerator name="bool" code="Tbol" description="Boolean (yes or no)">
				<cocoa integer-value="2"/>
			</enumerator>
			<enumerator name="label" code="Tlbl" description="Finder label (0-7)">
				<cocoa integer-value="3"/>
			</enumerator>
			<enumerator name="date" code="Tdat" description="Date">
				<cocoa integer-value="4"/>
			</enumerator>
			<enumerator name="OSType" code="Tost" description="OSType (4-byte code)">
				<cocoa integer-value="5"/>
			</enumerator>
			<enumerator name="kind" code="Tknd" description="Kind">
				<cocoa integer-value="6"/>
			</enumerator>
			<enumerator name="filter" code="Tflt" description="Filter (show, hide, show exclusively)">
				<cocoa integer-value="7"/>
			</enumerator>
			<enumerator name="amount" code="Tcnt" description="A plain number">
				<cocoa integer-value="8"/>
			</enumerator>
			<enumerator name="pass results to" code="Tpas" description="For passing results to a file or application">
				<cocoa integer-value="9"/>
			</enumerator>
			<enumerator name="content" code="Tcon" description="File content">
				<cocoa integer-value="10"/>
			</enumerator>
			<enumerator name="none" code="Tnon" description="No type">
				<cocoa integer-value="11"/>
			</enumerator>
			<enumerator name="equals number" code="Tnon" description="Identical to number">
				<cocoa integer-value="12"/>
			</enumerator>
			<enumerator name="scripted" code="Tscr" description="Scripted matching">
				<cocoa integer-value="13"/>
			</enumerator>
		</enumeration>

		<!-- we have overlapping verbs for various types, so this can't work.
			See https://stackoverflow.com/questions/79862735
		<enumeration name="textual verbs" code="tVrb" description="Verbs for rules">
			<enumerator name="contains segments of" code="tVfr" description="contains">
				<cocoa integer-value="9"/>
			</enumerator>
			<enumerator name="is" code="tVis" description="is">
				<cocoa integer-value="1"/>
			</enumerator>
			<enumerator name="contains exactly" code="tVcp" description="contains phrase">
				<cocoa integer-value="0"/>
			</enumerator>
		</enumeration>
		-->

		<class name="search domain" code="SDom" description="The locations where FAF searches" inherits="item">
			<cocoa class="SearchDomains"/>
			<property name="id" code="ID  " type="integer" description="Its unique identifier." access="r">
				<cocoa key="uniqueID"/>
			</property>
			<property name="targets" code="SDlc" description="The search targets as they're saved, with placeholders." access="r">
				<cocoa key="scriptableTargets"/>
				<type type="text" list="yes"/>
			</property>
			<property name="current locations" code="SDcp" description="The actual folders to be searched on the current system." access="r">
				<cocoa key="scriptableSearchURLs"/>
				<type type="file" list="yes"/>
			</property>
		</class>

		<class name="rule set" code="SSpc" description="A set of rules for a search" inherits="item">
			<cocoa class="SearchSpecs"/>
			<property name="id" code="ID  " type="integer" access="r" description="Its unique identifier.">
				<cocoa key="uniqueID"/>
			</property>
			<property name="short title" code="SSSt" type="text" description="The title as shown in the search window and menus, and as the file name when saved." access="r">
				<cocoa key="title"/>
			</property>
			<property name="runs as root" code="SSRr" type="boolean" description="Whether to run this search as root user." access="r">
				<cocoa key="runAsRoot"/>
			</property>
			<property name="autostart" code="SSAs" type="boolean" description="Whether to run this search when opening it in FAF." access="r">
				<cocoa key="autostart"/>
			</property>
			<property name="created by build number" code="SSSb" type="integer" description="Build number of FAF that created this search set." access="r">
				<cocoa key="savedByVersion"/>
			</property>
			<property name="search domain" code="SSDo" type="search domain" description="The locations in which to search." access="r">
				<cocoa key="sources"/>
			</property>
			<element type="rule" description="The search rules." access="r">
				<cocoa key="specs"/>
				<!-- cannot currently be looked up by name -->
				<accessor style="index"/>
				<accessor style="id"/>
			</element>
			<property name="json representation" code="SSJs" type="text" description="The search data in JSON form, just like when the search is saved to a file." access="rw">
				<cocoa key="asJSONString"/>
			</property>
			<!-- not working because record-types can't handle arrays, it seems:
			<property name="raw values" code="SSRw" type="raw search set record" description="The search data in raw form, like an expanded version of the JSON string." access="r">
				<cocoa key="exportForSaveAsDictionary"/>
			</property>
			-->
		</class>

		<class name="rule" code="SRul" description="A search rule." inherits="item">
			<cocoa class="SearchSpec"/>
			<property name="id" code="ID  " type="integer" access="r" description="Its unique identifier.">
				<cocoa key="uniqueID"/>
			</property>
			<property name="noun" code="SRNo" type="search nouns" description="The noun of the rule." access="r">
				<cocoa key="scriptableNoun"/>
			</property>
			<property name="search type" code="SRTy" type="search types" description="The type of the rule." access="r">
				<cocoa key="scriptableType"/>
			</property>
			<property name="verb code" code="SRVe" type="integer" description="The verb of the rule as a number." access="r">
				<cocoa key="scriptableVerb"/>
			</property>
			<property name="argument" code="SRVa" type="text" description="The input value." access="r">
				<cocoa key="scriptableValue"/>
			</property>
			<property name="script name" code="SRSn" type="text" description="The script to use." access="r">
				<cocoa key="scriptName"/>
			</property>
		</class>

		<class name="result set" code="RSet" description="A collection of result items." inherits="item">
			<cocoa class="ResultSet"/>
			<property name="id" code="ID  " type="integer" access="r" description="Its unique identifier.">
				<cocoa key="uniqueID"/>
			</property>
			<property name="state" code="Rstt" type="result states" description="The state of the result." access="r">
				<cocoa key="scriptedState"/>
			</property>
			<property name="search rules" code="Sset" type="rule set" access="r" description="The search that these results are based upon. May be 'missing value' if there was no search (e.g. if user opens a new Results window and then drags files into the window).">
				<cocoa key="scriptedSearchSpecs"/>
			</property>
			<property name="root item" code="Sroo" type="result item" access="r" description="The root item when looking at the results hierarchically. When traversing the tree, make sure to check the 'intermediate' property as it indicates whether each item is actually part of the found or manually added items.">
				<cocoa key="scriptedRootItem"/>
			</property>
			<element type="result item" access="r" description="Contains all items that match the search rules or were manually added, i.e. all their 'intermediate' values are false.">
				<cocoa key="scriptedMatches"/>
			</element>
 		</class>

		<enumeration name="result states" code="RStE" description="The progress states of a result. It always starts with `gathering` and ends with `finished`.">
			<enumerator name="gathering" code="RSS0" description="The search is still ongoing, i.e. items are still being added.">
				<cocoa integer-value="0"/>
			</enumerator>
			<enumerator name="stopping" code="RSS1" description="The search is being stopped.">
				<cocoa integer-value="1"/>
			</enumerator>
			<enumerator name="finished" code="RSS2" description="The result is ready.">
				<cocoa integer-value="2"/>
			</enumerator>
		</enumeration>

		<class name="result item" code="RItm" description="A single result item shown in a Results window" inherits="item">
			<cocoa class="ResultItem"/>
			<property name="id" code="ID  " type="integer" access="r" description="Its unique identifier.">
				<cocoa key="uniqueID"/>
			</property>
			<property name="name" code="pnam" type="text" description="The POSIX path of the disk item, in order to tell app items easily apart." access="r">
				<cocoa key="scriptablePath"/>
			</property>
			<property name="intermediate" code="itrM" type="boolean" description="Does this item only exist in the hierarchy to lead to a found item? In other words, is this item not part of the matched items listed by the result set?" access="r">
				<cocoa key="scriptableIsIntermediate"/>
			</property>
			<property name="disk item" code="Rdit" type="disk item" description="The unique file or folder object." access="r">
				<cocoa key="diskItemScriptable"/>
			</property>
			<property name="parent" code="pare" type="result item" description="The parent item in the file system hierarchy." access="r">
				<cocoa key="parentScriptable"/>
			</property>
			<element type="result item" description="The matched children the file system hierarchy." access="r">
				<cocoa key="childrenScriptable"/>
			</element>
		</class>

		<class name="disk item" code="DItm" description="A file system item" inherits="item">
			<cocoa class="DiskItem"/>
			<property name="id" code="ID  " type="text" access="r" description="Its unique identifier.">
				<cocoa key="uniqueID"/>
			</property>
			<property name="posix name" code="pNam" type="text" description="The POSIX name of the file or folder. This is the real file name, not the one the Finder may show. The Finder shows ':' in file names as '/', and may also localize them." access="r">
				<cocoa key="fileName"/>
			</property>
			<property name="finder name" code="fdrN" type="text" description="The name of the file or folder as shown by Finder on the current system. It can change, e.g. if the System language is changed, so don't use this to look up a file – use `posix name` instead." access="r">
				<cocoa key="scriptableFinderName"/>
			</property>
			<property name="location" code="pLoc" type="file" description="The current file reference." access="r">
				<cocoa key="originalURL"/>
			</property>
			<property name="posix path" code="pPth" type="text" description="The POSIX path of the file or folder." access="r">
				<cocoa key="originalPath"/>
			</property>
			<property name="creation date" code="ascd" description="The date the item was created." type="date" access="r">
				<cocoa key="creationDate"/>
			</property>
			<property name="modification date" code="asmo" description="The date the item was last modified." type="date" access="r">
				<cocoa key="modificationDate"/>
			</property>
		</class>

	</suite>
</dictionary>
