Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

uandme72

macrumors 68020
Original poster
Mar 2, 2015
2,092
686

Is there any macOS Shortcut which exports all reminders in Reminders app to text/ CSV file, and another shortcut which imports all reminders in a CSV file to macOS Reminders app?​

 
Use Automator to make a Workflow with this Javascript, then add the Workflow as a service in Reminders.

You can see it in my screenshot. Run the service and you will get the text of your reminders copied to the clipboard. Paste that into a .txt file and you are good to go.

Screenshot 2024-12-15 at 8.34.41 AM.png

Code:
function run(input, parameters) {
   
    // 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." });
}

    return input;
}
 
Last edited:
  • Like
Reactions: NoBoMac
Basic outline to create a CSV of all Reminders in Shortcuts attached. And an example of how to read in a basic CSV file.

But no Shortcut that does it all. Need to craft your own solution.

And one thing I don't like about CSVs is that need to deal with commas in values, ie need to quote on output, strip out quotes when reading in, as no native CSV parser in Shortcuts. Dictionary files are a cleaner way of doing it as Shortcuts handles the parsing/processing of value, but a bit more overhead (read: a little more busy code).
 

Attachments

  • e1.png
    e1.png
    167.9 KB · Views: 44
  • e2.png
    e2.png
    145.1 KB · Views: 43
Last edited:
And easiest to make a copy, but cannot import into Reminders, attached. Will create a zip file of each Reminder as an ics file. Useful if just wanting a backup to reference via text editor of choice.

e3.png
 
Last edited:
Use Automator to make a Workflow with this Javascript, then add the Workflow as a service in Reminders.

You can see it in my screenshot. Run the service and you will get the text of your reminders copied to the clipboard. Paste that into a .txt file and you are good to go.

View attachment 2462609

Code:
function run(input, parameters) {
  
    // 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." });
}

    return input;
}
how to import the text file into reminders again.
any shortcut/ automation for importing as well?
 
Basic outline to create a CSV of all Reminders in Shortcuts attached. And an example of how to read in a basic CSV file.

But no Shortcut that does it all. Need to craft your own solution.

And one thing I don't like about CSVs is that need to deal with commas in values, ie need to quote on output, strip out quotes when reading in, as no native CSV parser in Shortcuts. Dictionary files are a cleaner way of doing it as Shortcuts handles the parsing/processing of value, but a bit more overhead (read: a little more busy code).
can you provide a shortcut copied somewhere (like iCloud Drive), which can be clicked to import straightaway into the Shortcuts app (sorry, was just trying to reduce my work).
 
how to import the text file into reminders again.
any shortcut/ automation for importing as well?
I am not aware of a way to import them back in.

In my case, I have 15 reminder items going out almost three years, so if disaster struck and somehow they disappeared, I guess I could manually reenter everything from my text file I have backed up in multiple places.

I sync using iCloud and have never lost any reminder data, so hopefully I'll never have to use my text file backup.
 
I am not aware of a way to import them back in.

In my case, I have 15 reminder items going out almost three years, so if disaster struck and somehow they disappeared, I guess I could manually reenter everything from my text file I have backed up in multiple places.

I sync using iCloud and have never lost any reminder data, so hopefully I'll never have to use my text file backup.
I have about 1600 reminders in my list. related to multiple organizations I am dealing with. so for me importing is essential in case of disaster.
 
  • Like
Reactions: Weaselboy
I just noticed something new that might work for you. A recent OS update allowed the display of reminders in the Calendar app. If I select one of those reminders in the Calendar, then go to export, it creates a .ics file of the reminders. I'm assuming this could be imported. You might try exporting these, then make a test account on your Mac to try out importing to Calendar. I'd be curious if you import these into the Calendar if it also puts them back in the Reminders app.

Screenshot 2024-12-17 at 9.40.06 AM.png

Screenshot 2024-12-17 at 9.40.47 AM.png
 
  • Like
Reactions: NoBoMac
I just noticed something new that might work for you. A recent OS update allowed the display of reminders in the Calendar app. If I select one of those reminders in the Calendar, then go to export, it creates a.ics file of the reminders. I'm assuming this could be imported. You might try exporting these, then make a test account on your Mac to try out importing to Calendar. I'd be curious if you import these into the Calendar if it also puts them back in the Reminders app.

View attachment 2463410

View attachment 2463412
a reminder shows up in calendar app only if it has "remind me" activated on a day etc.
if the reminder is merely added in Reminders app as a list, then it does not show in calendars app. Hence when majority items are without a date and time alarm (remind me), this option of using calendars app does not serve much useful purpose.
 
  • Like
Reactions: Weaselboy
What @Weaselboy said in both posts.

I too have no import function set up: will cross that bridge, code that up if major disaster strikes.
 
  • Like
Reactions: Weaselboy
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.