在OSX上自动启动MarkLogic

时间:2015-01-07 20:36:58

标签: macos marklogic

MarkX的MarkX版本在“系统偏好设置”中安装了偏好设置面板,但它并未提供在您登录时自动启动MarkLogic的选项。

Another MarkLogic developer created a launchd config启动它,但我无法使其工作(在OSX 10.10中)。还有另一种自动化方法吗?

1 个答案:

答案 0 :(得分:5)

使用AppleScript:

tell application "System Preferences"
    activate
    set current pane to pane "MarkLogic"
end tell

tell application "System Events"
    tell application process "System Preferences"
        set toggle to button 1 of group 1 of window 1
        if title of toggle is "Start MarkLogic Server" then
            click toggle
        end if
    end tell
end tell

tell application "System Preferences"
    quit
end tell
  1. 将此脚本另存为应用程序(不是.scpt脚本文件)。
  2. 打开系统偏好设置>用户&分组并选择您的用户 希望MarkLogic自动启动,然后选择登录项 选项卡在右侧。
  3. 单击加号按钮并导航到该位置 保存的应用程序,然后单击“添加”。
  4. OSX 10.11 El Capitan Update

    在10.11中,MarkLogic的首选项窗格中的一个项目索引并非始终可靠。此脚本将实现相同的目标,并且应与以前的OSX版本向后兼容。按照上面的步骤1-3使用此脚本:

    do shell script "~/Library/StartupItems/MarkLogic/MarkLogic start"