danielpunkass / RemindersImport

Command-line tool for migrating Mac OS X Reminders from the canonical system storage to The Omni Group's OmniFocus app.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Catalina and LaunchAgents or Cron

jcg3 opened this issue · comments

commented

Is there any known way to get this to run under LaunchAgents or cron on macOS Catalina?

I get rejections based on permissions when I try:

CoreData: XPC: Unable to load metadata: Error Domain=NSCocoaErrorDomain Code=134070 "An error occurred in the persistent store." UserInfo={Problem=request failed, insufficient permission}
CoreData: error: -addPersistentStoreWithType:NSXPCStore configuration:(null) URL:file:///Users/jcg3/Library/Calendars/Calendar%20Cache options:{
    NSInferMappingModelAutomaticallyOption = 1;
    NSMigratePersistentStoresAutomaticallyOption = 1;
    NSPersistentHistoryTrackingKey =     {
        NSPersistentHistoryTrackingEntitiesToExclude =         (
            ChangeRequest
        );
    };
    agentOrDaemon = 1;
    serviceName = "com.apple.CalendarAgent.database";
} ... returned error NSCocoaErrorDomain(134070) with userInfo dictionary {
    Problem = "request failed, insufficient permission";
}

I'm able to run the program successfully via the command line - but when I do that I get prompted by the OS to grant permission.

Assuming this is a blocking issue by Catalina, do you have any other suggestions for how to run it on a semi-regular basis like Automator, Hazel, Keyboard Maestro, etc.?

commented

For what it is worth, you can drag /sbin/launchd and/or /usr/sbin/cron into the system preferences to grant them "full disk access", but you cannot drag anything into the lists for Calendar or Reminders. ☹️

Thanks for reporting this. I've been traveling but I want to catch up on this next week sometime.

I'm a looking a little closer at this now, and I can't remember how/what I did to make this work. I'm not getting prompted for any permissions. I think maybe I just ran the RemindersImport tool manually once and then did agree to the permissions? Then if it's run by launchd later it just works?

I sort of have a vague memory that in fact I switched from cron to launchd because of this.

Yeah, I confirmed I have RemindersImport, the binary itself, in the list of approved apps for Reminders & Calendar.

commented

Same for me - the first time I ran RemindersImport I think it prompted me for RemindersImport and also for Terminal to be able to access the reminders and calendar. I only see Terminal in my approved apps, but the RemindersImport program works without permission errors.

This may very well be a bug in the permissions system - when it runs via LaunchAgent or cron, should it be prompting for access?

Or it may be a design decision - they don't think launchd and crond should have access to those things because security reasons.

If it's baked into Catalina, maybe this should really be a feature request for OmniFocus to support the Reminders import on the Mac. Or maybe you could sell a $5 app that sits in the menu bar and pulls reminders every couple minutes.

Yeah, I don't know what the reasoning is if it's prompting for cron and/or launchd. I definitely would like to see Omni incorporate this feature into the Mac app. They already have something like it on iOS, but of course it can only run (I think) when the app has been activated.

Closing this but feel free to add additional comments if you have them.

I am facing exactly same issue on Catalina. It would be helpful If some one could tell me how to run the RemindersImport tool. I could find the import option in Calendar but not in Reminders. I did try importing in Calendar but that didn't help.

@tulsidaskolekar Not sure what exact issue you're facing but if you are having the exact same problem as described here it should be solved by running the RemindersImport tool manually to give it approval, and then setting up a launchd-based mechanism for auto-running the tool periodically.

@danielpunkass Thanks for the response. Could you let me know, where can I find the RemindersImport tool. Is it something I need to download it, I couldn't locate it on my Mac

@tulsidaskolekar Unfortunately it's not built in on the Mac, it's something that you have to compile yourself with developer tools. I just shared it here because I thought other developers would find it handy, but I don't really support it as a product.