How To Copy Reminders In macOS Catalina With a Script

You can't copy and paste or print Reminders in macOS Catalina. However, with the help of a script you can get a Reminders list as text to be pasted into any app, printed, or sent as email. Learn how to create a Mac script in JavaScript (JXA) using Script Editor or Automator to get this important function back and have it available as an easy-access menu command.



Here is the script:

// set things up
var app = Application('Reminders');
app.includeStandardAdditions = true;

// choose list
var listName = app.chooseFromList(app.lists.name(), { withPrompt: "Which List?" });
if (listName) {

	// get the data from the list
	var remindersList = app.lists.byName(listName).reminders;
	var listNames = remindersList.name();
	var listCompleted = remindersList.completed();
	var listDueDates = remindersList.dueDate();
	var listBodies = remindersList.body();
	
	// create a single array
	var list = [];
	for(var i=0; i<listNames.length; i++) {
		list.push({name: listNames[i], completed: listCompleted[i], dueDate: listDueDates[i], body: listBodies[i]});
	}
	
	// sort the list
	//list.sort((a, b) => (a.name > b.name));
	//list.sort((a, b) => (a.dueDate > b.dueDate));

	// build text from list
	var text = "";
	var n = 0;
	for(var i=0; i<list.length; i++) {
	
		// get item item including due date and notes
		var item = list[i].name;
		if (list[i].dueDate) item += " [Due: " + list[i].dueDate + "]";
		if (list[i].body) item += " [Note: " + list[i].body + "]";
		
		// non-completed items
		if (!list[i].completed) {
    		text += "☐ " + item + "\n";
			n++;
			
		// completed items
		} else {
			//text += "☑ " + item + "\n";
  			//n++;
		}
	}
	
	// pass to clipboard
	app.setTheClipboardTo(text);

	// show message
	app.displayAlert("Reminders Copied", { message: n+" copied to the clipboard." });
}

Comments: 12 Responses to “How To Copy Reminders In macOS Catalina With a Script”

    Dana Stevens
    4 years ago

    Extremely interesting. I really enjoy posts like this. I do wish you preferred AppleScript but JavaScript is better than nothing. Thanks for sharing this.

    4 years ago

    Dana: Thanks. As a programmer I find AppleScript to be very ... well, I don't like it at all. JavaScript is not only more modern, but used for a lot of things throughout tech.

    Drew Nelles
    4 years ago

    Dear Gary, Great tutorial, as always. One question: What is the best resource to learn Javascript **for MacOS**? I've looked, but all I find are references to learning Javascript for HTML, and none with Apple specific commands, such as - for example - Is it app.setTextEditto(text); if I wanted to save it to a Text Edit file instead of the clip board above? If there isn't one, what's the best way to make the fork to MacOS from HTML focused Javascript? I'm just beginning to learn JS. Thanks!

    4 years ago

    Drew: There is no "good" resource at all. You can find a scattering of examples online if you search for things like "Mac javascript jxa". For reference, look in the Library in the Script Editor app on your Mac. There is both an AppleScript and JavaScript reference there. It is devoid of examples, but at least you can find the functions and properties there. Only rely on browser JavaScript resources for very basic things like loops, conditions, string functions, etc. And it takes lots of trial and error and Google searching. It IS frustrating.

    John Bianca
    4 years ago

    Nice! Here's what I did. Lol I put my "Grocery" and "To Do" Lists into the NOTES app into one Note. No annoying extra suggestions from Reminders. I can set the size of the text, easy to read, easy to edit, no unwanted Notes, Add Date, or Add Location. And I can copy, paste, print, whatever. Easy peasy. I figure Apple will add the Copy and Print feature to Reminders, but I may stay with NOTES anyway. It's clean, simple, easy to enter, organize, and manage. That's all I want in a LIST app.

    Faisal Jaffer
    4 years ago

    Hi, this was unbeleivably helpful.
    I tried editing the code to list by priority but could not get it to work.
    If its easily possible for you, could you post the script for that.
    Thanks

    Jay Muir
    4 years ago

    Thank you!! This is so helpful and simple to follow. I've been searching for months for a workaround to print Reminders after Catalina blocked the ability to copy/paste. This does the trick perfectly.

    T Falls
    4 years ago

    Excellent! Works perfectly for a standard simple list.

    However, Reminders has 2 new features that are missed with this script; Groups and Sub Tasks. Hoping you or someone posts an update to this script. I have a number of lists that make use of these 2 great features. Thanks!!

    steve
    4 years ago

    Echoing T Falls — I'm stumped on how to get Groups to work in scripting. Any examples would be much appreciated!!

    Christopher Larkin
    4 years ago

    This is very cool - thank you for sharing it! I've been (re)learning JavaScript again because it's so useful with our Google automation.

    Any thoughts on how to get the subtasks in Catalina? I built a few templates in a second list and I'd love to be able to copy items from the template into a new task (with the subtasks) in my main Reminders app.

    4 years ago

    Christopher: I've never tried to work with Reminders subtasks. Since they are very new, there may not be any hooks yet.

    Kenneth Goodman
    4 years ago

    Thanks! Freaking Apple

Comments Closed.