This repository has no description
1<?xml version="1.0" encoding="UTF-8"?>
2<!DOCTYPE dictionary SYSTEM "file://localhost/System/Library/DTDs/sdef.dtd">
3
4<dictionary title="Ghostty Scripting Dictionary">
5 <suite name="Ghostty Suite" code="Ghst" description="Ghostty scripting support.">
6 <class name="application" code="capp" description="The Ghostty application.">
7 <cocoa class="NSApplication"/>
8 <property name="name" code="pnam" type="text" access="r" description="The name of the application."/>
9 <property name="frontmost" code="pisf" type="boolean" access="r" description="Is this the active application?">
10 <cocoa key="isActive"/>
11 </property>
12 <property name="front window" code="GFWn" type="window" access="r" description="The frontmost Ghostty window.">
13 <cocoa key="frontWindow"/>
14 </property>
15 <property name="version" code="vers" type="text" access="r" description="The version number of the application."/>
16 <responds-to command="perform action">
17 <cocoa method="handlePerformActionScriptCommand:"/>
18 </responds-to>
19 <responds-to command="new window">
20 <cocoa method="handleNewWindowScriptCommand:"/>
21 </responds-to>
22 <responds-to command="new tab">
23 <cocoa method="handleNewTabScriptCommand:"/>
24 </responds-to>
25 <responds-to command="new surface configuration">
26 <cocoa method="handleNewSurfaceConfigurationScriptCommand:"/>
27 </responds-to>
28 <responds-to command="quit">
29 <cocoa method="handleQuitScriptCommand:"/>
30 </responds-to>
31
32 <element type="window" access="r">
33 <cocoa key="scriptWindows"/>
34 </element>
35
36 <element type="terminal" access="r">
37 <cocoa key="terminals"/>
38 </element>
39 </class>
40
41 <class name="window" code="Gwnd" plural="windows" description="A Ghostty window containing one or more tabs.">
42 <cocoa class="GhosttyScriptWindow"/>
43 <property name="id" code="ID " type="text" access="r" description="Stable ID for this window."/>
44 <property name="name" code="pnam" type="text" access="r" description="The title of the window.">
45 <cocoa key="title"/>
46 </property>
47 <property name="selected tab" code="GWsT" type="tab" access="r" description="The selected tab in this window.">
48 <cocoa key="selectedTab"/>
49 </property>
50 <responds-to command="activate window">
51 <cocoa method="handleActivateWindowCommand:"/>
52 </responds-to>
53 <responds-to command="close window">
54 <cocoa method="handleCloseWindowCommand:"/>
55 </responds-to>
56 <element type="tab" access="r">
57 <cocoa key="tabs"/>
58 </element>
59 <element type="terminal" access="r">
60 <cocoa key="terminals"/>
61 </element>
62 </class>
63
64 <class name="tab" code="Gtab" plural="tabs" description="A tab within a Ghostty window.">
65 <cocoa class="GhosttyScriptTab"/>
66 <property name="id" code="ID " type="text" access="r" description="Stable ID for this tab."/>
67 <property name="name" code="pnam" type="text" access="r" description="The title of the tab.">
68 <cocoa key="title"/>
69 </property>
70 <property name="index" code="pidx" type="integer" access="r" description="1-based index of this tab in its window."/>
71 <property name="selected" code="GTsl" type="boolean" access="r" description="Whether this tab is selected in its window."/>
72 <property name="focused terminal" code="GTfT" type="terminal" access="r" description="The currently focused terminal surface in this tab.">
73 <cocoa key="focusedTerminal"/>
74 </property>
75 <responds-to command="select tab">
76 <cocoa method="handleSelectTabCommand:"/>
77 </responds-to>
78 <responds-to command="close tab">
79 <cocoa method="handleCloseTabCommand:"/>
80 </responds-to>
81 <element type="terminal" access="r">
82 <cocoa key="terminals"/>
83 </element>
84 </class>
85
86 <class name="terminal" code="Gtrm" plural="terminals" description="An individual terminal surface.">
87 <cocoa class="GhosttyScriptTerminal"/>
88 <property name="id" code="ID " type="text" access="r" description="Stable ID for this terminal surface."/>
89 <property name="name" code="pnam" type="text" access="r" description="Current terminal title.">
90 <cocoa key="title"/>
91 </property>
92 <property name="working directory" code="Gwdr" type="text" access="r" description="Current working directory for the terminal process."/>
93 <property name="pid" code="Gpid" type="integer" access="r" description="PID of the foreground process in this terminal."/>
94 <property name="tty" code="Gtty" type="text" access="r" description="TTY device path for this terminal (e.g. /dev/ttys016)."/>
95 <responds-to command="split">
96 <cocoa method="handleSplitCommand:"/>
97 </responds-to>
98 <responds-to command="focus">
99 <cocoa method="handleFocusCommand:"/>
100 </responds-to>
101 <responds-to command="close">
102 <cocoa method="handleCloseCommand:"/>
103 </responds-to>
104 </class>
105
106 <record-type name="surface configuration" code="GScf" description="Reusable settings applied when creating a terminal surface.">
107 <property name="font size" code="GScF" type="real" description="Font size in points.">
108 <cocoa key="fontSize"/>
109 </property>
110 <property name="initial working directory" code="GScD" type="text" description="Initial working directory for the terminal process.">
111 <cocoa key="workingDirectory"/>
112 </property>
113 <property name="command" code="GScC" type="text" description="Command to execute instead of the configured shell.">
114 <cocoa key="command"/>
115 </property>
116 <property name="initial input" code="GScI" type="text" description="Input sent to the terminal after launch.">
117 <cocoa key="initialInput"/>
118 </property>
119 <property name="wait after command" code="GScW" type="boolean" description="Keep the terminal open after command exit.">
120 <cocoa key="waitAfterCommand"/>
121 </property>
122 <property name="environment variables" code="GScE" description="Environment variables in KEY=VALUE format.">
123 <type type="text" list="yes"/>
124 <cocoa key="environmentVariables"/>
125 </property>
126 </record-type>
127
128 <enumeration name="split direction" code="GSpD" description="Direction for a new split.">
129 <enumerator name="right" code="GSrt" description="Split to the right."/>
130 <enumerator name="left" code="GSlf" description="Split to the left."/>
131 <enumerator name="down" code="GSdn" description="Split downward."/>
132 <enumerator name="up" code="GSup" description="Split upward."/>
133 </enumeration>
134
135 <enumeration name="input action" code="GIAc" description="Whether an input is pressed or released.">
136 <enumerator name="press" code="GIpr" description="Press."/>
137 <enumerator name="release" code="GIrl" description="Release."/>
138 </enumeration>
139
140 <enumeration name="mouse button" code="GMBt" description="A mouse button.">
141 <enumerator name="left button" code="GMlf" description="Left mouse button."/>
142 <enumerator name="right button" code="GMrt" description="Right mouse button."/>
143 <enumerator name="middle button" code="GMmd" description="Middle mouse button."/>
144 </enumeration>
145
146 <enumeration name="scroll momentum" code="GSMo" description="Momentum phase for inertial scrolling.">
147 <enumerator name="none" code="SMno" description="No momentum."/>
148 <enumerator name="began" code="SMbg" description="Momentum began."/>
149 <enumerator name="changed" code="SMch" description="Momentum changed."/>
150 <enumerator name="ended" code="SMen" description="Momentum ended."/>
151 <enumerator name="cancelled" code="SMcn" description="Momentum cancelled."/>
152 <enumerator name="may begin" code="SMmb" description="Momentum may begin."/>
153 <enumerator name="stationary" code="SMst" description="Stationary."/>
154 </enumeration>
155
156 <command name="perform action" code="GhstPfAc" description="Perform a Ghostty action string on a terminal.">
157 <direct-parameter type="text" description="The Ghostty action string."/>
158 <parameter name="on" code="GonT" type="terminal" description="Target terminal."/>
159 <result type="boolean" description="True when the action was performed."/>
160 </command>
161
162 <command name="new surface configuration" code="GhstNSCf" description="Create a reusable surface configuration object.">
163 <parameter name="from" code="GScS" type="surface configuration" optional="yes" description="Surface configuration to copy.">
164 <cocoa key="configuration"/>
165 </parameter>
166 <result type="surface configuration" description="The newly created surface configuration."/>
167 </command>
168
169 <command name="new window" code="GhstNWin" description="Create a new Ghostty window.">
170 <parameter name="with configuration" code="GNwS" type="surface configuration" optional="yes" description="Base surface configuration for the initial terminal.">
171 <cocoa key="configuration"/>
172 </parameter>
173 <result type="window" description="The newly created window."/>
174 </command>
175
176 <command name="new tab" code="GhstNTab" description="Create a new Ghostty tab.">
177 <parameter name="in" code="GNtW" type="window" optional="yes" description="Target window for the new tab.">
178 <cocoa key="window"/>
179 </parameter>
180 <parameter name="with configuration" code="GNtS" type="surface configuration" optional="yes" description="Base surface configuration for the initial terminal.">
181 <cocoa key="configuration"/>
182 </parameter>
183 <result type="tab" description="The newly created tab."/>
184 </command>
185
186 <command name="split" code="GhstSplt" description="Split a terminal in the given direction.">
187 <direct-parameter type="specifier" description="The terminal to split."/>
188 <parameter name="direction" code="GSpd" type="split direction" description="The direction to split.">
189 <cocoa key="direction"/>
190 </parameter>
191 <parameter name="with configuration" code="GSpS" type="surface configuration" optional="yes" description="Base surface configuration for the new split terminal.">
192 <cocoa key="configuration"/>
193 </parameter>
194 <result type="terminal" description="The newly created terminal."/>
195 </command>
196
197 <command name="focus" code="GhstFcus" description="Focus a terminal, bringing its window to the front.">
198 <direct-parameter type="specifier" description="The terminal to focus."/>
199 </command>
200
201 <command name="close" code="GhstClos" description="Close a terminal.">
202 <direct-parameter type="specifier" description="The terminal to close."/>
203 </command>
204
205 <command name="activate window" code="GhstAcWn" description="Activate a Ghostty window, bringing it to the front.">
206 <direct-parameter type="specifier" description="The window to activate."/>
207 </command>
208
209 <command name="select tab" code="GhstSlTb" description="Select a tab in its window.">
210 <direct-parameter type="specifier" description="The tab to select."/>
211 </command>
212
213 <command name="close tab" code="GhstClTb" description="Close a tab.">
214 <direct-parameter type="specifier" description="The tab to close."/>
215 </command>
216
217 <command name="close window" code="GhstClWn" description="Close a window.">
218 <direct-parameter type="specifier" description="The window to close."/>
219 </command>
220
221 <command name="input text" code="GhstInTx" description="Input text to a terminal as if it was pasted.">
222 <cocoa class="GhosttyScriptInputTextCommand"/>
223 <direct-parameter type="text" description="The text to input."/>
224 <parameter name="to" code="GItT" type="terminal" description="The terminal to input text to.">
225 <cocoa key="terminal"/>
226 </parameter>
227 </command>
228
229 <command name="send key" code="GhstSKey" description="Send a keyboard event to a terminal.">
230 <cocoa class="GhosttyScriptKeyEventCommand"/>
231 <direct-parameter type="text" description="The key name (e.g. "enter", "a", "space")."/>
232 <parameter name="action" code="GKeA" type="input action" optional="yes" description="Press or release (default: press).">
233 <cocoa key="action"/>
234 </parameter>
235 <parameter name="modifiers" code="GKeM" type="text" optional="yes" description="Comma-separated modifier keys: shift, control, option, command.">
236 <cocoa key="modifiers"/>
237 </parameter>
238 <parameter name="to" code="GKeT" type="terminal" description="The terminal to send the key event to.">
239 <cocoa key="terminal"/>
240 </parameter>
241 </command>
242
243 <command name="send mouse button" code="GhstSMBt" description="Send a mouse button event to a terminal.">
244 <cocoa class="GhosttyScriptMouseButtonCommand"/>
245 <direct-parameter type="mouse button" description="The mouse button."/>
246 <parameter name="action" code="GMbA" type="input action" optional="yes" description="Press or release (default: press).">
247 <cocoa key="action"/>
248 </parameter>
249 <parameter name="modifiers" code="GMbM" type="text" optional="yes" description="Comma-separated modifier keys: shift, control, option, command.">
250 <cocoa key="modifiers"/>
251 </parameter>
252 <parameter name="to" code="GMbT" type="terminal" description="The terminal to send the event to.">
253 <cocoa key="terminal"/>
254 </parameter>
255 </command>
256
257 <command name="send mouse position" code="GhstSMPs" description="Send a mouse position event to a terminal.">
258 <cocoa class="GhosttyScriptMousePosCommand"/>
259 <parameter name="x" code="GMpX" type="real" description="Horizontal position in pixels.">
260 <cocoa key="x"/>
261 </parameter>
262 <parameter name="y" code="GMpY" type="real" description="Vertical position in pixels.">
263 <cocoa key="y"/>
264 </parameter>
265 <parameter name="modifiers" code="GMpM" type="text" optional="yes" description="Comma-separated modifier keys: shift, control, option, command.">
266 <cocoa key="modifiers"/>
267 </parameter>
268 <parameter name="to" code="GMpT" type="terminal" description="The terminal to send the event to.">
269 <cocoa key="terminal"/>
270 </parameter>
271 </command>
272
273 <command name="send mouse scroll" code="GhstSMSc" description="Send a mouse scroll event to a terminal.">
274 <cocoa class="GhosttyScriptMouseScrollCommand"/>
275 <parameter name="x" code="GMsX" type="real" description="Horizontal scroll delta.">
276 <cocoa key="x"/>
277 </parameter>
278 <parameter name="y" code="GMsY" type="real" description="Vertical scroll delta.">
279 <cocoa key="y"/>
280 </parameter>
281 <parameter name="precision" code="GMsP" type="boolean" optional="yes" description="High-precision scroll (e.g. trackpad). Default: false.">
282 <cocoa key="precision"/>
283 </parameter>
284 <parameter name="momentum" code="GMsM" type="scroll momentum" optional="yes" description="Momentum phase for inertial scrolling. Default: none.">
285 <cocoa key="momentum"/>
286 </parameter>
287 <parameter name="to" code="GMsT" type="terminal" description="The terminal to send the event to.">
288 <cocoa key="terminal"/>
289 </parameter>
290 </command>
291 </suite>
292
293 <!--
294 The Standard Suite definition below is copied from Apple's
295 /System/Library/ScriptingDefinitions/CocoaStandard.sdef, trimmed to only
296 include what we need.
297 -->
298 <suite name="Standard Suite" code="????" description="Common classes and commands for all applications.">
299 <command name="count" code="corecnte" description="Return the number of elements of a particular class within an object.">
300 <cocoa class="NSCountCommand"/>
301 <access-group identifier="*"/>
302 <direct-parameter type="specifier" requires-access="r" description="The objects to be counted."/>
303 <parameter name="each" code="kocl" type="type" optional="yes" description="The class of objects to be counted." hidden="yes">
304 <cocoa key="ObjectClass"/>
305 </parameter>
306 <result type="integer" description="The count."/>
307 </command>
308
309 <command name="exists" code="coredoex" description="Verify that an object exists.">
310 <cocoa class="NSExistsCommand"/>
311 <access-group identifier="*"/>
312 <direct-parameter type="any" requires-access="r" description="The object(s) to check."/>
313 <result type="boolean" description="Did the object(s) exist?"/>
314 </command>
315
316 <command name="quit" code="aevtquit" description="Quit the application.">
317 <cocoa class="NSQuitCommand"/>
318 </command>
319 </suite>
320</dictionary>