Writing Keyboard Maestro Macros With ChatGPT

I asked ChatGPT to write me a KM macro, and to my surprise it did.

It suggests I can just copy the XML into the window, but when I do this, I actually just get an empty group.

What is it doing wrong?

Note: The macro is just to open a list of URLs

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>MacroActionType</key>
	<string>Group</string>
	<key>MacroActions</key>
	<array>
		<dict>
			<key>MacroActionType</key>
			<string>SetVariableToText</string>
			<key>Text</key>
			<string>https://example1.com
https://example2.com
https://example3.com</string>
			<key>Variable</key>
			<string>urlList</string>
		</dict>
		<dict>
			<key>Collection</key>
			<string>split(urlList, "\n")</string>
			<key>Instance</key>
			<string>currentURL</string>
			<key>MacroActionType</key>
			<string>For</string>
			<key>MacroActions</key>
			<array>
				<dict>
					<key>MacroActionType</key>
					<string>OpenURL</string>
					<key>URL</key>
					<string>%Variable%currentURL%</string>
				</dict>
			</array>
		</dict>
	</array>
</dict>
</plist>

Not really. It generated an example of its coarse-grained statistical impression of what macros should look like.

( A rough sketch of an owl is recognisable, but unlikely, on the whole, to fly, or catch a mouse )

5 Likes

That's not a good plan in my opinion.

Macros can destroy all of the data on your computer, and if you're unable to completely vet the code – you may end up very sorry indeed.

4 Likes

Inevitably, someone will eventually use ChatGPT with KM. Therefore, why not integrate now to minimize future damage in the long run?

ChatGPT is a good cliché generator (as Neil Gaiman puts it, it generates "information-shaped sentences" rather than information), but to produce reasonably plausible cliché you need to have cooked your statistical model of language probabilities on a large amount of input data.

ChatGPT hasn't seen enough online KM macro source code to be able to do that, and as there isn't much there, it's unlikely to have done so in the future.


And while it constitutes a large database of language probabilities, it involves no model whatsoever of reality or reliability.

Australian mayor readies world's first defamation lawsuit over ChatGPT content | Reuters

1 Like

I am confident that ChatGPT has the potential to become the next "Google" for the masses once they incorporate search metadata into the platform. The fact that people are impressed with ChatGPT's ability to provide human-like responses is something that cannot be ignored. Just as there are people who only use their latest iPhones for making calls and watching TikTok, I believe that ChatGPT (or a similar technology) will become an integral part of everyone's lives. In the future, tools like ChatGPT could be used for tasks such as rephrasing or reconstructing emails, or creating flow charts based on text input, making it an everyday tool. I am hopeful that Keyboard Maestro will also be a part of this movement, so I can continue to benefit from my favorite macro app.

I know nothing about coding, but I asked chatGPT to write some apple scripts. Most of them didn’t work right away, but i got a few to work after telling it the various issues and troubleshooting. A lot of times the best ones involved taking a script I got from someone else and asking for help modifying. I got a script from MacSparky for moving emails in mail app that I needed modified to fit my weird mailbox structure. I also successfully had ChatGPT generate a script that pulled a few email attributes and put in the clipboard. Nothing fancy, but much better than I could do on my own.

1 Like