This is a simple one and applies to many more aspects of life than enterprise scripting. If you know from the onset that you are not going to enjoy this work, plan appropriately. Aka, find someone else to do it. If you don’t love it, you are going to have a challenging time consistently outputting high quality work. This work never ends, it’s a practice of constant iteration and improvement. If you didn’t enjoy creating the automation process the first time, you are going to hate doing it the second time. Be honest with yourself, automation may not be for you and if it is not adjust your career accordingly. Now, is every second of scripting an absolute blast? No. Sometimes it can be rough when you are troubleshooting something nothing seems to make sense. But, all in all the overall process should be way more fun than not.
Variety is the spice of life. Try to surround yourself by highly motivated people with a deep and wide skillset. Be sure to expose them to your work as often as possible because getting other people’s input on how you accomplish an automation feat can spark the creative juices you need to allow for an even better more dynamic solution next time. Keep yourself open to new things and don’t be afraid to fail. In fact, you should expect to fail from time to time. Frankly, if you never fail that probably means you were too risk adverse and may have missed on some exciting projects. Stay in tuned with the latest trends and technology and keep focused on implementing them into any future work whenever possible. Make time to learn. Maybe dedicate every other friday to creating a proof of concept for a unused methodology, language or tooling.
Finally, everyone scripts differently. Find out what works for you and make it the norm. Find a routine that works and try not to differ from it. This is another useful tactic to apply to many aspects of life. If you want to be productive at something establish a pattern of putting yourself in a position to be productive. If that means you code from 3-6pm every day so be it. You can even try to use object association to get to your coding sweet spot. Maybe that is you need a tall glass of tea or some classical music find whatever your sweet spot is and then do it every time. Getting yourself in a productive routine is a great thing. And knowing that your time is being used effeciently and your work is making a difference goes a long way to keeping yourself entertained and engaged.