mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-24 02:35:20 +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
32 lines
694 B
C++
32 lines
694 B
C++
// -*- C++ -*-
|
|
/**
|
|
* \file AppleScript.h
|
|
* 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.
|
|
*/
|
|
|
|
#ifndef LYX_SUPPORT_APPLESCRIPT_H
|
|
#define LYX_SUPPORT_APPLESCRIPT_H
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
/// What is returned by applescript_execute_command
|
|
typedef struct {
|
|
int code;
|
|
char *message;
|
|
} LyXFunctionResult;
|
|
|
|
LyXFunctionResult applescript_execute_command(const char *cmd, const char *args);
|
|
|
|
/// Sets up apple script support
|
|
void setupApplescript();
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif |