Cursor AI Automation for DT4 and All Else Mac

For anyone with an interest in scripting or automating of DT4 or any other Mac apps I will give a strong +1 suggesting a trial of Cursor AI.

When I heard of Cursor initially I thought of it as something mainly useful for writing code. But it turns out it actually does superbly well as an “AI Agent” managing the use of your Mac and especially tying together different apps.

I decided to give Cursor a try in order to create an Anthropic MCP integration with Keyboard Maestro. I do have that working - which means that I can use Claude Desktop or Cursor to execute any Keyboard Maestro macro from an LLM. It works well and I will likely share that project separately, as of course Keyboard Maestro integration means Applescript integration which in turn means DT4 integration.

But once I started using it, I realized that Cursor AI is so capable that I really do not need MCP. I can just tell Cursor what I want to achieve with my Mac and it both suggests and implements solutions.

For example I was trying to figure out how to save content from non-DT4 LLM chats in Devonthink. I knew Applescript can easily do that with the DT4 group selector - but the harder part was passing a file to DT4. Cursor proposed a shell script to format the filename appropriately - and it works well.

Most notably - Cursor is aware of the entire “codebase” or in this case aware of everything in my automation folder. In particualr, I can set up a rules fille instructing Cursor to review a README file every time I open a new Chat/context window. Cursor can even write the README file and update it whenever I add new automations. This is an example - it’s not all that meaningful without seeing all of my KM macros and scripts - but my point is to show how it can help keep your automation organized and can make use of LLM-based automation more predictable. In a way it is a natural language form of automation coding for the LLM:

README.md.zip (4.9 KB)

As has been dicsussed in numerous threads, AI does not replace coding. To benefit from this you need a fairly big-picture concept of what you want to automate and what tools to use. But it’s really good at creating basic Applescripts and shell scripts for almost anything - and it functions as an “AI Agent” well enough to be pretty good at debugging/fixing the things it does not get right first time. It can also maintain Github repositories for your projects along with notes of what changed. I never do README and commit notes for my own personal projects but I know I should - and Cursor thus makes it so much easiesr to return to my own projects at a later date when I may have forggotten the details. And the structure/documentation makes it really easy for Cursor itself to reuse snippets from past projects as part of new tasks.

Cursor has definitely earned a place in my toolbox particularly where I want to integrate DT4 with other local Mac apps or with web apps.

2 Likes