You can't do this directly - once Keyboard Maestro is quit then you're dead in the water.
You could save the script as an applet though and then use a Keyboard Maestro macro to activate the applet. That would handoff the task while Keyboard Maestro was quitting and restarting.
I keep other script runner utilities on my system for just such tasks. FastScripts or LaunchBar could do this much more conveniently than an applet.
Regular script - non-applet version:
-------------------------------------------------------------------------------------------
# Auth: Christopher Stone
# dCre: 2017/03/12 14:29
# dMod: 2017/03/12 14:38
# Appl: Keyboard Maestro, Keyboard Maestro Engine, System Events
# Task: Quit the Keyboard Maestro Editor and Engine then restart the Engine.
# Libs: None
# Osax: None
# Tags: @Applescript, @Script, @Keyboard_Maestro, @Keyboard_Maestro_Editor, @Keyboard_Maestro_Engine, @System_Events, @Quit, @Editor, @Engine, @Restart
-------------------------------------------------------------------------------------------
try
tell application "Keyboard Maestro"
quit
end tell
tell application "Keyboard Maestro Engine"
quit
end tell
set theCntr to 0
set theDelay to 0.5
tell application "System Events"
repeat while length of (get processes whose name contains "Keyboard Maestro Engine") > 0
set theCntr to theCntr + 1
if theCntr > 20 then
error "There was a problem quitting Keyboard Maestro!"
end if
delay theDelay
end repeat
end tell
tell application "Keyboard Maestro Engine"
run
end tell
on error e number n
set e to e & return & return & "Num: " & n
if n ≠ -128 then
try
tell application (path to frontmost application as text) to set ddButton to button returned of ¬
(display dialog e with title "ERROR!" buttons {"Copy Error Message", "Cancel", "OK"} ¬
default button "OK" giving up after 30)
if ddButton = "Copy Error Message" then set the clipboard to e
end try
end if
end try
-------------------------------------------------------------------------------------------
Try it out and see if you like it – but also look at Alfred.
LaunchBar hasn't seen much major development for quite some time now, but Alfred keeps on trucking.
I've used LaunchBar for nearly 20 years, but I'm going to reevaluate after testing Alfred again sometime soon. Alfred does some things LaunchBar can't, and that intrigues me.
But – those features will have to make it worth dropping my daily driver and undertaking a new learning curve – and I'll have to be able to live with the UI.
I’ve no attachment to LB. I’m only looking to run this thread’s script. Will Alfred do that?
Generally, I’m doing almost everything with palette triggers and have no interest in keyboarding ironic as that may sound. I just looked at LB over fastscripts thinking there might be some more functionality that I could pull into my KM palette palace. I’d view Alfred the same.