<?xml version="1.0" encoding="utf-8" standalone="yes"?>

<?xml-stylesheet href="./_c74_ref.xsl" type="text/xsl"?>

<!--This is an automatically generated file. DO NOT EDIT THIS FILE DIRECTLY. Rather, use the _ref.xml files found in the 'edits' folder.-->
<c74object name="thispatcher" module="max" category="Control, Patching">
	<digest>
		Send messages to a patcher
	</digest>
	<description>
		Allows modification of a patcher window with Max messages.
	</description>
	<!--METADATA-->
	<metadatalist>
		<metadata name="author">
			Cycling '74
		</metadata>
		<metadata name="tag">
			Max
		</metadata>
		<metadata name="tag">
			Control
		</metadata>
		<metadata name="tag">
			Patching
		</metadata>
	</metadatalist>
	<!--INLETS-->
	<inletlist>
		<inlet id="0" type="INLET_TYPE">
			<digest>
				Messages (write,dispose,etc.) to Send to Patcher
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
		<inlet id="1" type="INLET_TYPE">
			<digest>
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
	</inletlist>
	<!--OUTLETS-->
	<outletlist>
		<outlet id="0" type="OUTLET_TYPE">
			<digest>
				Output From window info Messages
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
		<outlet id="1" type="OUTLET_TYPE">
			<digest>
				Pathname If patcher Is a File
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
	</outletlist>
	<snapshot />
	<!--ARGUMENTS-->
	<objarglist>
		<objarg id="0" name="OBJARG_NAME" type="OBJARG_TYPE" optional="0">
			<digest>
				TEXT_HERE
			</digest>
			<description>
				TEXT_HERE
			</description>
		</objarg>
	</objarglist>
	<!--MESSAGES-->
	<methodlist>
		<method name="anything">
			<arglist>
				<arg name="message" optional="0" type="list" />
			</arglist>
			<digest>
				Evaluate and execute message
			</digest>
			<description>
				See <m>&quot;Patcher Messages&quot;</m> and <m>&quot;Scripting Messages&quot;</m> discussion.
			</description>
		</method>
		<method name="end">
			<arglist />
			<digest>
				Internal use only
			</digest>
			<description>
				Used internally.
			</description>
		</method>
		<method name="savewindow">
			<arglist>
				<arg name="flag" optional="0" type="int" />
			</arglist>
			<digest>
				Save settings with the patch
			</digest>
			<description>
				The word <m>savewindow</m>, followed by a non-zero number, means that any unusual window settings caused by <m>window flags</m> messages to <o>thispatcher</o> will be saved as part of the patch the next time the patch is saved. The message <m>savewindow 0</m> means that changes to the window caused by <m>window flags</m> messages to <o>thispatcher</o> will not be retained when the patch is saved; the prior patcher window settings are saved. If no <m>savewindow</m> message has been received, the patcher will be saved with a normal window appearance.
			</description>
		</method>
	</methodlist>
	<!--ATTRIBUTES-->
	<!--EXAMPLE-->
	<examplelist>
		<example img="thispatcher.png" caption="Automatic window control, file saving, or patcher reset are possible with thispatcher... Windows can have any size, location, and appearance, set within the patch itself" />
	</examplelist>
	<!--SEEALSO-->
	<seealsolist>
		<seealso name="bpatcher" />
		<seealso name="bgcolor" />
		<seealso name="join" />
		<seealso name="pack" />
		<seealso name="patcher" />
		<seealso name="pattrforward" />
		<seealso name="pcontrol" />
		<seealso name="pvar" />
		<seealso name="sprintf" />
		<seealso name="interfacechapter01" module="max" type="tutorial" />
	</seealsolist>
	<discussion>
		<o>thispatcher</o> can be used to modify and/or close a patcher window - it sends a message to the patcher window in which it is contained. See the <o>bpatcher</o> help file for the use of the <o>thispatcher</o> object with bpatchers.
		<br />
		Note: Use of the <o>thispatcher</o> object to create new objects is not supported.
	</discussion>
	<misc name="Patcher Behavior and Display">
		<entry name="The script message">
			<description>
				The <m>script</m> message to <o>thispatcher</o> permits dynamic control over object creation, deletion, sizing and positioning, and patching. The word <m>script</m> is followed by a keyword that indicates a function. Following the keyword are arguments that specify what objects are to be affected by the message.
				<br />
				<br />
				In the discussion of each <m>script</m> message that follows, the syntax indicates required arguments for the message after the keyword in angle brackets. An example of each message is also provided.
				<br />
				<br />
				A variable-name is a symbol that names either a new or existing object. You can set variable names by choosing Name... from the Object menu, or with certain scripting messages such as <m>new</m> and <m>select</m>.
			</description>
		</entry>
	</misc>
	<misc name="Patcher Messages">
		<entry name="clean">
			<description>
				The <m>clean</m> message resets the patch's dirty bit in the window so that you won't be asked to save changes in the patch.
			</description>
		</entry>
		<entry name="dirty">
			<description>
				The <m>clean</m> message is the opposite of the <m>clean</m> method; it sets the patch's dirty bit in the window.
			</description>
		</entry>
		<entry name="dispose">
			<description>
				*USE AT YOUR OWN RISK* - Closes the patcher or destroys the subpatcher that the <o>thispatcher</o> object is contained in.
			</description>
		</entry>
		<entry name="front">
			<description>
				The <m>front</m> message brings the window that contains the <o>thispatcher</o> object to the front. If the patcher is not open, the message opens the patch and brings it to the front.
			</description>
		</entry>
		<entry name="loadbang">
			<description>
				The <m>loadbang</m> message will send the <m>loadbang</m> message to all objects in the patch - including the <o>loadbang</o> object itself.
			</description>
		</entry>
		<entry name="lockdown">
			<description>
				The <m>lockdown</m> message will disable editing of the patcher.
			</description>
		</entry>
		<entry name="path">
			<description>
				The <m>path</m> message will send the full pathname of the patcher that contains the <o>thispatcher</o> object out the right outlet of the <o>thispatcher</o> object.
				<br />
				<br />
				The <m>path</m> message to <o>thispatcher</o> does not work within a subpatcher.
			</description>
		</entry>
		<entry name="title">
			<description>
				The <m>title</m> message, followed by a symbol, will change the title displayed in the patcher window.
			</description>
		</entry>
		<entry name="write">
			<description>
				The word <m>write</m>, followed by an optional symbol that specifies a filename, saves the patcher window with that filename to disk. If no file name is specified, a standard File Dialog will be presented for the user to manually choose a file name.
			</description>
		</entry>
	</misc>
	<misc name="Scripting Messages">
		<entry name="newdefault">
			<description>
				Creates a new named object with default properties in a patcher window.
				<br />
				<br />
				Syntax: <m>script newdefault <i>&lt;variable-name&gt;</i>  <i>&lt;creation message&gt;</i> </m> 				<br />
				<br />
				Example: <m>script newdefault thatgraph 10 10 filtergraph~</m> 				<br />
				<br />
				Creates a new <o>filtergraph~</o> object at its default size at 10 10 and assign it to the variable thatgraph.
				<br />
				<br />
				Example: <m>script newdefault buffy 200 100 pack foo bar bap</m> 				<br />
				<br />
				Creates a new <o>pack</o> object instantiated with the arguments foo bar bap at 200 100 and assign it to the variable buffy.
			</description>
		</entry>
		<entry name="new">
			<description>
				Creates a new object in a patcher window and gives it a name.
				<br />
				<br />
				Syntax: <m>script new <i>&lt;variable-name&gt;</i>  <i>&lt;creation message&gt;</i> </m> 				<br />
				<br />
				Example: <m>script new footog toggle 101 93 15 0</m> 				<br />
				<br />
				Creates a new <o>toggle</o> object 15 pixels square at 101 93 and assign it to the variable footog.
				<br />
				<br />
				The format of the arguments (after the class name) to the <m>script new</m> message are based on the legacy Max file format.
			</description>
		</entry>
		<entry name="delete">
			<description>
				Deletes an object in a patcher window.
				<br />
				<br />
				Syntax: <m>script delete <i>&lt;variable-name&gt;</i> </m> 				<br />
				<br />
				Example: <m>script delete footog</m> 				<br />
				<br />
				Deletes the object associated with the variable name <m>footog</m>.
			</description>
		</entry>
		<entry name="hidden">
			<description>
				Specifies that an object (or connection) will be hidden when created.
				<br />
				<br />
				Example: <m>script hidden new footog toggle 101 93 15 0</m> 				<br />
				<br />
				Creates a hidden object associated with the variable name <m>footog</m>. The <m>hidden</m> keyword can also be used when specifying connections between objects.
			</description>
		</entry>
		<entry name="class">
			<description>
				Assigns a variable name to the first instance of a specified class with matching arguments
				<br />
				<br />
				Syntax: <m>script class <i>&lt;variable-name&gt;</i>  <i>&lt;class-name&gt;</i>  <i>&lt;arguments (optional)&gt;</i> </m> 				<br />
				<br />
				Example: <m>script class rubadub + 4</m> 				<br />
				<br />
				Assigns the name <m>rubadub</m> to the first instance found of <o>+</o> with argument <m>4</m> in the patcher.
			</description>
		</entry>
		<entry name="nth">
			<description>
				Assigns a variable name to the nth instance of a specified class
				<br />
				<br />
				Syntax: <m>script nth <i>&lt;variable-name&gt;</i>  <i>&lt;class-name&gt;</i>  <i>&lt;index&gt;</i> </m> 				<br />
				<br />
				Example: <m>script nth yoyo toggle 1</m> 				<br />
				<br />
				Assigns the name <m>yoyo</m> to the first <o>toggle</o> found in the patcher.
				<br />
				<br />
				The order of objects in a patcher is determined by the front-to-back ordering. Objects in back of the patcher that draw behind other objects are first in the search order.
			</description>
		</entry>
		<entry name="selected">
			<description>
				Assigns a variable name to the first object found that is selected
				<br />
				<br />
				Syntax: <m>script selected <i>&lt;variable-name&gt;</i> </m> 				<br />
				<br />
				Example: <m>script selected impo</m> 				<br />
				<br />
				Assigns the name <m>impo</m> to the first object found that is selected. Obviously this <m>script</m> message only works when the patcher is unlocked, since no object can be selected in a locked patcher.
				<br />
				<br />
				For all three connection messages described below, inlets and outlets are specified by <m>index</m>, with 0 denoting the leftmost inlet or outlet. The first variable specified is the object whose outlet you are connecting or disconnecting and the second variable is the one whose inlet you are connecting. Messages can then flow from outlet to inlet.
			</description>
		</entry>
		<entry name="connect">
			<description>
				Connects two objects together with a patch cord
				<br />
				<br />
				Syntax: <m>script connect <i>&lt;outlet-variable-name&gt;</i>  <i>&lt;outlet-index&gt;</i>  <i>&lt;inlet-variable-name&gt;</i>  <i>&lt;inlet-index&gt;</i> </m> 				<br />
				<br />
				Example: <m>script connect fooboo 0 bobo 0</m> 				<br />
				<br />
				Connects the left outlet of the object with the variable name <m>fooboo</m> to the left inlet of the object with the variable name <m>bobo</m>.				<br />
				<br />
				Note: Adding the keyword <m>hidden</m> (e.g., <m>script hidden connect fooboo 0 bobo 0)</m> creates hidden connections.
			</description>
		</entry>
		<entry name="disconnect">
			<description>
				Disconnect two objects connected by a patch cord
				<br />
				<br />
				Syntax: <m>script disconnect <i>&lt;outlet-variable-name&gt;</i>  <i>&lt;outlet-index&gt;</i>  <i>&lt;inlet-variable-name&gt;</i>  <i>&lt;inlet-index&gt;</i> </m> 				<br />
				<br />
				Example: <m>script disconnect fooboo 0 bobo 0</m> 				<br />
				<br />
				This message undoes the connection between the left outlet of <m>fooboo</m> and the left <m>inlet</m> of bobo.
			</description>
		</entry>
		<entry name="connectcolor">
			<description>
				Modify the color of an existing patch cord, setting it to one of Max's 16 standard colors.
				<br />
				<br />
				Syntax: <m>script connectcolor <i>&lt;outlet-variable-name&gt;</i>  <i>&lt;outlet-index&gt;</i>  <i>&lt;inlet-variable-name&gt;</i>  <i>&lt;inlet-index&gt;</i>  <i>&lt;color&gt;</i> </m> 				<br />
				<br />
				Example: <m>script connectcolor rover 0 dover 2 12</m> 				<br />
				<br />
				Changes the color of the connection between the left outlet of the <m>rover</m> object with the 3rd inlet of the <m>dover</m> object to the color stored at index 12.
			</description>
		</entry>
		<entry name="hide">
			<description>
				Hide a visible object.
				<br />
				<br />
				Syntax: <m>script hide <i>&lt;variable-name&gt;</i> </m> 				<br />
				<br />
				Example: <m>script hide visigoth</m> 				<br />
				<br />
				Hides the object named <m>visigoth</m> 
			</description>
		</entry>
		<entry name="show">
			<description>
				Show a hidden object.
				<br />
				<br />
				Syntax: <m>script show <i>&lt;variable-name&gt;</i> </m> 				<br />
				<br />
				Example: <m>script show visigoth</m> 				<br />
				<br />
				Makes the object named <m>visigoth</m> visible.
			</description>
		</entry>
		<entry name="ignoreclick">
			<description>
				Set an object not to respond to mouse clicks.
				<br />
				<br />
				Syntax: <m>script ignoreclick <i>&lt;variable-name&gt;</i> </m> 				<br />
				<br />
				Example: <m>script ignoreclick visigoth</m> 				<br />
				<br />
				Makes the object named <m>visigoth</m> ignore mouse clicks.
			</description>
		</entry>
		<entry name="respondtoclick">
			<description>
				Set an object to respond to mouse clicks.
				<br />
				<br />
				Syntax: <m>script respondtoclick <i>&lt;variable-name&gt;</i> </m> 				<br />
				<br />
				Example: <m>script respondtoclick visigoth</m> 				<br />
				<br />
				Makes the object named <m>visigoth</m> respond to mouse clicks.
			</description>
		</entry>
		<entry name="bringtofront">
			<description>
				Bring an object to the front of the layer it's currently in.
				<br />
				<br />
				Syntax: <m>script bringtofront <i>&lt;variable-name&gt;</i> </m> 				<br />
				<br />
				Example: <m>script bringtofront visigoth</m> 				<br />
				<br />
				If <m>visigoth</m> is in the foreground layer, this message moves it to the front of the foreground layer. Otherwise it moves it to the front of the background layer.
			</description>
		</entry>
		<entry name="sendtoback">
			<description>
				Move an object to the back of the layer it's currently in.
				<br />
				<br />
				Syntax: <m>script sendtoback <i>&lt;variable-name&gt;</i> </m> 				<br />
				<br />
				Example: <m>script sendtoback visigoth</m> 				<br />
				<br />
				If <m>visigoth</m> is in the foreground layer, this message moves it to the back of the foreground layer. Otherwise it moves it to the back of the background layer. Note that objects that are &quot;in the back&quot; are the first objects to be found by the variable assignment messages <m>nth</m> and <m>class</m>.
			</description>
		</entry>
		<entry name="size">
			<description>
				Change an object's size. There are some objects that have restrictions on their size, but they generally do not protect themselves against sizes they don't expect, so use this message with some caution. For instance the <o>toggle</o> object expects to be a square. It may not draw properly if it's made into a rectangle.
				<br />
				<br />
				Syntax: <m>script size <i>&lt;variable-name&gt;</i>  <i>&lt;width&gt;</i>  <i>&lt;height&gt;</i> </m> 				<br />
				<br />
				Example: <m>script size togipoo 30 30</m> 				<br />
				<br />
				Changes the object named <m>togipoo</m> to be 30 by 30 pixels.
				<br />
				<br />
				Sending Messages to Objects
			</description>
		</entry>
		<entry name="send">
			<description>
				Send a message to an object. This message is the same as using a <o>message</o> box with a semicolon or a <o>send</o> object, but you use the object variable name feature of scripting to specify the object that will receive the message -- using <m>script send</m> to communicate with a named <o>receive</o> object does not work. The message can only be sent to an object within the patcher as the <o>thispatcher</o> object receiving the <m>script send</m> message.
				<br />
				<br />
				Syntax: <m>script send <i>&lt;variable-name&gt;</i>  <i>&lt;message&gt;</i> </m> 				<br />
				<br />
				Example: <m>script send foobert 666</m> 				<br />
				<br />
				The object with the variable name <m>foobert</m> receives an <m>int 666</m> message. If <m>foobert</m> were a number box, its displayed value would change to 666.
			</description>
		</entry>
		<entry name="sendbox">
			<description>
				Send a message to an object box. This message is identical to <o>send</o> except that it sends the message to an object's box rather than the object referred to by the box. There is currently only one object, <o>bpatcher</o>, in which the object and box are different objects. The box is a <o>bpatcher</o>, and the object is a patcher. What can you tell a <o>bpatcher</o> to do? One example is the <m>boxborder</m> message, which is equivalent to sending the <m>border</m> message to a <o>thispatcher</o> object in a patcher inside a <o>bpatcher</o>. Peek inside the Inspector patch for <o>bpatcher</o> for other ideas.
				<br />
				<br />
				Syntax: <m>script sendbox <i>&lt;variable-name&gt;</i>  <i>&lt;message&gt;</i> </m> 				<br />
				<br />
				Example: <m>script sendbox bpbp boxborder 0</m> 				<br />
				<br />
				If <m>bpbp</m> names a <o>bpatcher</o> object, this <m>script</m> message would tell it not to draw its border.
			</description>
		</entry>
		<entry name="move">
			<description>
				Move an object to an absolute position relative to the current top-left corner of a patcher window. Note that the 0,0 point is underneath the icon bar.
				<br />
				<br />
				Syntax: <m>script move <i>&lt;variable-name&gt;</i>  <i>&lt;top&gt;</i>  <i>&lt;left&gt;</i> </m> 				<br />
				<br />
				Example: <m>script move molly 0 100</m> 				<br />
				<br />
				Moves the object named <m>molly</m> to the left edge of the window, 100 pixels down from the top.
			</description>
		</entry>
		<entry name="offset">
			<description>
				Move an object a distance from its current position. Positive distances move the object down and to the right, negative distances move it up and to the left.
				<br />
				<br />
				Syntax: <m>script offset <i>&lt;variable-name&gt;</i>  <i>&lt;delta-x&gt;</i>  <i>&lt;delta-y&gt;</i> </m> 				<br />
				<br />
				Example: <m>script offset molly 30 -40</m> 				<br />
				<br />
				Moves the object named <m>molly</m> 30 pixels to the right and 40 pixels up.
			</description>
		</entry>
		<entry name="offsetfrom">
			<description>
				Move an object a set distance from another object.
				<br />
				<br />
				Syntax: <m>script offsetfrom <i>&lt;variable-name-to-move&gt;</i>  <i>&lt;target-variable-name&gt;</i>  <i>&lt;top-left-flag&gt;</i>  <i>&lt;delta-x&gt;</i>  <i>&lt;delta-y&gt;</i> </m> 				<br />
				<br />
				The top-left-flag is 1 if the distance is relative to the top-left corner of the object, and 0 if it is relative to the bottom-right corner.
				<br />
				<br />
				Example: <m>script offsetfrom molly panther 1 -100 -120</m> 				<br />
				<br />
				Moves the object named <m>molly</m> 100 pixels to the left of the left side of the object named <m>panther</m>, and 120 pixels above the top of the object named <m>panther</m>.
			</description>
		</entry>
	</misc>
	<misc name="Output">
		<entry name="window">
			<description>
				Out left outlet: When the message <m>window getsize</m> is received, <o>thispatcher</o> sends out the words <m>window size</m> followed by the screen coordinates (in pixels from the top left corner of the screen) of the left, top, right, and bottom limits of the window. When the message <m>window gettitle</m> is received, the message <m>window title</m> or <m>window notitle</m> is sent out, depending on whether the window has a title bar. When the message <m>window getflags</m> is received, <o>thispatcher</o> sends out the words <m>window flags</m> followed by the visibility of the scroll bars and grow box (<m>grow</m> or <m>nogrow</m>), the close box (<m>close</m> or <m>noclose</m>), and the zoom box (<m>zoom</m> or <m>nozoom</m>).
			</description>
		</entry>
		<entry name="symbol">
			<description>
				Out right outlet: The full pathname of the folder or volume containing the patcher's file in response to the <m>path</m> message. If the patcher has not been saved, there is no output.
			</description>
		</entry>
	</misc>
</c74object>
