

Then in the following view, you will need to click Utilities in the leftmost menu and then double click Run Shell Script. Open your Applications directory in the Finder, and double click on the Automator icon.

The first, using the Automator app, will appeal to folks who feel most at home in the GUI, and the second two involve creating XML files and placing them in certain directories, the contents of which will be executed at either machine startup or user login.

Whatever your use case, there are three clear paths to executing an action at startup or login on macOS. Most recently, I needed to get a freshly spun-up Mac VM to register itself with a third party at startup. There are a variety of reasons you might need to run a process or script at startup or login on a Mac.
