+\change_inserted -1762856967 1393941760
+
+\end_layout
+
+\begin_layout Subsection
+
+\change_inserted -1762856967 1393941776
+AppleScript (Mac OS X)
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted -1762856967 1393941776
+Since LyX 2.1, LyX supports basic interactions with AppleScript for normal
+ communication through the command run.
+ This command takes a direct argument (the
+\series bold
+function
+\series default
+ to perform) and an optional argument.
+ It either returns the output of the function or triggers an error with
+ the error message and code.
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted -1762856967 1393941776
+Example:
+\end_layout
+
+\begin_layout LyX-Code
+
+\change_inserted -1762856967 1393941776
+tell application "LyX"
+\end_layout
+
+\begin_layout LyX-Code
+
+\change_inserted -1762856967 1393941776
+ try
+\end_layout
+
+\begin_layout LyX-Code
+
+\change_inserted -1762856967 1393941776
+ -- Stores the current file name into f
+\end_layout
+
+\begin_layout LyX-Code
+
+\change_inserted -1762856967 1393941776
+ set f to (run "server-get-filename" with argument "")
+\end_layout
+
+\begin_layout LyX-Code
+
+\change_inserted -1762856967 1393941776
+ on error the error_message number the error_number
+\end_layout
+
+\begin_layout LyX-Code
+
+\change_inserted -1762856967 1393941776
+ display dialog "Error: " & the error_number & ".
+ " ¬
+\end_layout
+
+\begin_layout LyX-Code
+
+\change_inserted -1762856967 1393941776
+ & the error_message buttons {"OK"} default button 1
+\end_layout
+
+\begin_layout LyX-Code
+
+\change_inserted -1762856967 1393941776
+ end try
+\end_layout
+
+\begin_layout LyX-Code
+
+\change_inserted -1762856967 1393941776
+end tell
+\change_unchanged
+