How to disable autohide dock autohide when the app closes

If you do not want to worry about creating a race condition and having to close UE4Editor before shutting down, as mentioned in the other answer, then there is a nice app called EventScripts, for $3.99 USD at the App Store, that you can use to trigger AppleScript scripts and or Shell scripts when certain events are triggered.

Here's an example AppleScript script that will hide/show the Dock when UE4Editor launches/quits:

on run eventArgs
    set theAppName to applicationName in eventArgs
    set theTrigger to trigger in eventArgs
    if theTrigger is "Application launched" and theAppName is "UE4Editor" then
        hideDock(true)
    else if theTrigger is "Application quit" and theAppName is "UE4Editor" then
        hideDock(false)
    end if
end run

on hideDock(b)
    tell application "System Events"
        set autohide of dock preferences to b
    end tell
end hideDock

In Script Editor, save the above AppleScript code as, e.g., UE4Editor - On Open and Close.scpt in ~/Library/Application Scripts/net.mousedown.EventScripts/, (after EventScripts is installed).

Now in EventScripts, add the same script twice, while setting the Event for one to Application launched and the other to Application quit.

Now, when UE4Editor launches, the Dock is hidden, and when UE4Editor quits the Dock is unhidden.

EventScripts

EventScripts has a long list of events it can trigger a script on. Check out the links below for more information:

  • EventScripts - Developers Website
  • EventScripts - Mac App Store Preview
  • EventScripts - Available Events and Parameters
  • EventScripts - Example Scripts

Note: I'm not affiliated with the developer of EventScripts, just a satisfied customer.


This depends on whether UE4Editor will launch from shell script, so I cannot test it... it works fine with TextEdit.

Save this as a standalone app, rather than a script. It should work as either, but an app is tidier.

tell application "System Events" to set autohide of dock preferences to true
tell current application to do shell script "/Applications/UE4Editor.app/Contents/MacOS/UE4Editor"  
tell application "System Events" to set autohide of dock preferences to false

As you are launching from shell script, the script app will hide the Dock, launch your editor, then simply wait until the UE4Editor quits, then continue from where it left off, hiding the Dock. It will then quit itself.
This does mean that it will look like it went Not Responding for the duration of your session, but that actually causes no issues in itself. I have script apps like this that sit open for a week or more & do no harm at all.

Note: If you reboot the Mac whilst this is running, the Mac itself will restore your last Editor session & therefore will be in a race condition with the script. Make sure to quit the editor before shutting down or rebooting.