Integrating ChatGPT with Tinderbox: A Poor Man's Solution

Like many of us these days, I use ChatGPT to streamline various productivity workflows. This week, I set out to integrate Tinderbox with ChatGPT to enhance my note-taking and thought organization.

Below is a simple yet flexible integration that requires minimal command-line (or Terminal) knowledge. No API sign-ups or subscriptions are needed—this works with the free version of ChatGPT. However, you do need to have the ChatGPT macOS app installed and set up.

Setup Steps

  1. Install the Shortcut. First, install this Shortcut, which allows Tinderbox to send input and receive output from the macOS ChatGPT app. Here’s a screenshot if you would like to create it yourself. (Note: The name of the shortcut needs to match the Shortuct name specified in the following step, which is ChatGPT.)

  2. Add Functions to Tinderbox’s “Library”. Next, add the following two functions to a note in your Tinderbox “Library” located in /Hints/Library:

    //
    // Runs the "shortcuts" command with the specified
    // shortcut name and input in data.
    //
    function runShortcut(stdin, shortcut) {
    	// Construct the Shortcut command
    	var:string cmd = "shortcuts run \"" + shortcut + "\"";
    
    	return runCommand(cmd, stdin, getDir()).trim;
    }
    
    //
    // Prompts ChatGPT with the given text.
    //
    function promptChatGPT(text) {
    	// Display a waiting message
    	show("⏳ Prompting ChatGPT, please wait...");
    
    	return runShortcut(text, "ChatGPT");
    }
    

    The first function, runShortcut(), allows one to run any Shortcut, while the second function promptChatGPT() calls runShortcut() to execute the ChatGPT Shortcut that was added in step 1.

  3. Create a Stamp to Send Notes to ChatGPT. Finally, create a Stamp that runs the promptChatGPT() function, using the $Text of the selected note(s) as the prompt:

    $Text += "\n\n---\n\n" + promptChatGPT($Text) + "\n\n---\n\n";
    

    Note: This Stamp appends the ChatGPT results to the selected note(s) using the selected notes’ $Text as input, effectively simulating a “chat”.

  4. Run the Stamp. Create a new note with a prompt as its $Text and apply the Stamp created in the previous step to it.

  5. Use and Enjoy! :beers:. That’s it! Now, you can use this setup to quickly query ChatGPT from within Tinderbox.

Limitations and Future Enhancements

One downside to this approach is that each time you prompt ChatGPT, it starts a new chat. Unfortunately, there doesn’t seem to be a way to programmatically delete chats or mark them as temporary. If anyone finds a workaround, I’d love to hear about it!

I hope this integration proves as useful for you as it has for me. Happy Tinderboxing!

11 Likes

great stuff, @JacobIO! Thank you for that.

it would really be nice to see a Tinderbox-Meetup in the not so distant future covering the basics of a copilot-esque AI-integration into Tinderbox as Jacob showcased here.

*i know that @webline already came up with some AI-TBX-Wizardry; and yet … i, too, know September 21, 2024, TBX-Meetup and Michael’s ChatGPT presentation there; and yet … *

is this feasible, @satikusala?

FWIW, I would be more than happy to showcase my ChatGPT integration method using Shortcuts, along with a few more advanced workflows, during a future meetup.

3 Likes

great. :pray:

let’s see what @satikusala thinks.

1 Like

Sweet. @JacobIO can you take a look at the meeup calendar, Tinderbox Meetup Calendar (2024, 2025), and let me know what date works for you? We’ll lock you in. :slight_smile: