ChatGPT and DT3 Scripting

ChatGPT is intriguing. Not only can it write prose but it can also write basic code.

It can even write Devonthink scripts!

You can set up a free account and play here:

1 Like

ChatGPT can only mix existent stuff. Don’t ask something original or not in its databases that then won’t answer well. As a sample I did some tests with money return combinations and it answered wrong to questions like “you have 5 coins of 1 cent, 5 of 10 cents, … then how do you will pay 12.33?” and it miserably failed to answer right, and even worse: if you trick it to try to pay, say 1.66 with no 1 cent coins, it crashed and restarted itself in half answer (you can pay, but pay first 1.60 and then 3 of 2 cents and not 1 of 5 cents and get a remainder of 1 cent non-payable).


I agree it is not sentient and creating novel ideas.

Still - even if it is just pulling examples from its database, arguably it is more useful at least in basic situations than even Stackoverflow.

As for your money examples, it does seem to have some accuracy issues there which is interesting for such simple questions.

Interestingly it is able to produce code with a better algorithm than it uses itself to calculate change:

See Human help needed! Script to create a list of file names in a group into a new markdown file - #2 by cgrunenberg

1 Like

It is like a child. It will just predict the next word. It started as autocorrect and now it can pass the bar exam.

It you ask, it will keep trying something. Even if the API doesn’t exist, it will try and try and try.

Don’t tell me that it won’t find a solution. It will, because as soon as you paste the API documentation, it then uses that to help with future predictions in the chat.

Check out what I was able to do with it for a DEVONthink + ChatGPT document summarizing tool:

1 Like

I am a novice at ChatGPT and DT3. I also do not have much experience with AppleScript, but am very interested in being able to summarize large documents. I have copied the second script and have provided the API key from ChatGPT and came up with a file with “null” as the only text. What should I fix?

The second script may be more difficult to troubleshoot since it doesn’t display anything for you during execution.

One way to start to see what is happening is to add lines like this:

display dialog theText

This will display theText in a dialog.

In my case, I was taking the text of the current document and sending it to chatGPT.

Hope that helps. You can ask ChatGPT to help with errors. If you give it the lines of code and the error, it can often help you at correcting the code.