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: 5 Responses to “How To Copy Reminders In macOS Catalina With a Script”

    Dana Stevens
    3 weeks 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.

    3 weeks 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
    3 weeks 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!

    3 weeks 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
    3 weeks 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.

Leave a New Comment Related to "How To Copy Reminders In macOS Catalina With a Script"

:
:
:
0/500 (500 character limit -- please state your comment succinctly and do not try to get around this limit by posting two comments)