mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 21:21:32 +00:00
4674c3e1c5
In order to interact with native osx applications, AppleScript support is a plus. Here is a patch that makes LyX respond to a simple command (run) and that allows to communicate with LyX as with the LyX client. Example of use: tell application "LyX" to run "server-get-filename" with argument ""' returns message:/Users/bpiwowar/newfile1.lyx, code:0 with a message and the error code
54 lines
1.8 KiB
XML
54 lines
1.8 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!DOCTYPE dictionary SYSTEM "file://localhost/System/Library/DTDs/sdef.dtd">
|
|
|
|
<!--
|
|
This file is part of LyX, the document processor.
|
|
Licence details can be found in the file COPYING.
|
|
|
|
author: Benjamin Piwowarski
|
|
|
|
Full author contact details are available in file CREDITS.
|
|
|
|
-->
|
|
|
|
|
|
<!-- declare the namespace for using XInclude so we can include the standard suite -->
|
|
<dictionary xmlns:xi="http://www.w3.org/2003/XInclude">
|
|
|
|
|
|
<!-- use XInclude to include the standard suite -->
|
|
<!-- <xi:include href="file:///System/Library/ScriptingDefinitions/CocoaStandard.sdef" xpointer="xpointer(/dictionary/suite)"/> -->
|
|
|
|
|
|
<!-- our special scripting suite for this example -->
|
|
<suite name="Lyx" code="LYX " description="LyX scripting facilities.">
|
|
|
|
<record-type name="LyX return value" code="LyxR">
|
|
<property name="code" code="code" type="integer"
|
|
description="Error code (0 in case of success).">
|
|
<cocoa key="code"/>
|
|
</property>
|
|
<property name="message" code="mess" type="text"
|
|
description="The returned message.">
|
|
<cocoa key="message"/>
|
|
</property>
|
|
</record-type>
|
|
|
|
<command name="run" code="SLyxComm" description="run a simple command with one parameter">
|
|
<cocoa class="LyxCommand"/>
|
|
|
|
<direct-parameter description="The command to be executed.">
|
|
<type type="text" list="no"/>
|
|
</direct-parameter>
|
|
|
|
<parameter name="with argument" code="args" type="text">
|
|
<cocoa key="arg"/>
|
|
</parameter>
|
|
|
|
<result type="LyX return value" description="Contains a code (0 for success) and the message returned by LyX"/>
|
|
</command>
|
|
|
|
</suite>
|
|
|
|
|
|
</dictionary> |