OSX版本的MarkLogic会在“系统偏好设置”中安装一个偏好设置窗格,但没有提供登录时自动启动MarkLogic的选项。
另一位MarkLogic开发人员创建了一个启动配置来启动它,但我无法使其正常运行(在OSX 10.10中)。还有另一种方法可以自动化吗?
使用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
OSX 10.11 El Capitan更新
在10.11中,MarkLogic的“首选项窗格”中的项目索引之一并非始终可靠。该脚本将实现相同的目标,并且应与以前的OSX版本向后兼容。使用此脚本执行上述步骤1-3:
do shell script "~/Library/StartupItems/MarkLogic/MarkLogic start"
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句