Autostart MarkLogic on OSX

The OSX version of MarkLogic installs a preference bar in system preferences, but it does not provide the ability to automatically launch MarkLogic whenever you log in.

Another developer MarkLogic created a launchd config to get it running, but I was unable to get it to work (on OSX 10.10). Is there any other way to automate this?

+3


source to share


1 answer


Using 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

      

  • Save this script as an application (not a .scpt script file).
  • Go to System Preferences> Users & Groups and select the user for whom you would like MarkLogic to start automatically, then select the Login Items tab on the right.
  • Click the plus button and navigate to the location of your saved app and click Add.


OSX 10.11 El Capitan Update

At 10.11, one of the item indexes in the MarkLogic preference pane is not always reliable. This script will accomplish the same goal and should be backward compatible with previous OSX versions. Follow steps 1-3 above with this script:

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

      

+5


source







All Articles