Applescript: Help with idle and hiding from finder?

I stumbled across this link that provides a step-by-step guide to implementing the solution to this problem using launchd.

For convenience, I've copied and formatted the relevant contents of the linked page below.

How to fix QuickLookUIService memory/CPU issues in High Sierra

If you're having issues with high memory (or CPU) usage on High Sierra, this is the result of a bug with the QuickLookUIService which appears to have been introduced in that version and which unfortunately has not yet been fixed. The only workaround right now is to repeatedly force quit the quicklookuiservice.

  1. Create a new file in your favourite text editor (if you use Apple's Text Edit, make sure the file is in plain text format)

  2. Paste the xml at the end of these steps into the file

  3. Rename the file to the same as what's within the <string> tags with a .plist extension (in my example, com.zerowidth.launched.killquicklook.plist)

  4. Copy the file to your library in the LaunchAgents folder (in Finder you can use Go > Go to folder > /Users/[yourusername]/Library/LaunchAgents. You may need to type an administrator password to authorize this action

  5. After your next login/restart, you should find the memory issues caused by this to be back to normal. If you ever want to remove the service, just delete the plist file

Some explanation of what this does

A launch agent is a service that helps manage applications in Mac OS. In this case, we've written our own small launch agent program that kills the quicklook service repeatedly at an interval (the killall -9 -v QuickLookUIService part). The name of the service is within the tags (you can call it what you like) and the interval is within the <integer> tags (in my case, 5600 seconds). Feel free to change the interval to whatever works best for you (if you set it higher, it will interfere less with your normal use of preview, but also allow the service to use more memory). As a final note, bear in mind that if you are previewing a document when the service restarts, the preview will fail (you can just preview again immediately).

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
    <dict>
        <key>Label</key>
        <string>com.zerowidth.launched.killquicklook</string>
        <key>ProgramArguments</key>
        <array>
            <string>sh</string>
            <string>-c</string>
            <string>killall -9 -v QuickLookUIService</string>
        </array>
        <key>StartInterval</key>
        <integer>5600</integer>
    </dict>
</plist>


Note: Expanded to answer from comment dated Dec 10 '18 at 20:29

Thanks @CJK for the solution I ended up using... creating a launch agent: https://discussions.apple.com/thread/8506070

Super helpful step-by-step even if you don't know anything about launch agents.

using the launch agent version of this fix keeps from taxing additional system resources. My battery life basically tripled or quadrupled now that the buggy, energy-sapping quicklookhelper gets shut down quickly.