icalBuddy Doesn't Work Within Keyboard Maestro. Mojave Calendar Permissions?

Fantastic, thank you! I tested it out and it works great!

1 Like

In case anyone ends up here in the future, there is a up to date repo with releases of the icalbuddy app here: https://github.com/DavidKaluta/icalBuddy64

I tried to contact the developer/maintainer of that Github repo to offer him the fix, but never heard back from him.

Last I tried, that version did not work with Keyboard Maestro either. If you have found otherwise, please let us know.

1 Like

Ah hah, ok great to know. I didn't try the version there, i just found it and was excited to find it and wanted to share. It looks like he's accepted a few pull requests, but for some reason the issues are not enabled in the repo.

Disabling issues is Github’s version of saying “I can't be bothered to look into anything that doesn't affect me directly.”

Yep. Do you happen to have the code that was changed? I can post a pull request to be merged in, or create a live fork on github so others have access to it?

Here is what Robby Pählig, developer of LaunchControl, Backup Loupe, and others wrote about this change:

I would not call it a proper fix because I don't know if it works for the built-in test suite or on other versions of macOS.

Here is the diff. It shows where the change happened and what has been changed:

And here's his patch:

diff --git a/icalBuddyFunctions.m b/icalBuddyFunctions.m
index f01283a..27f140e 100644
--- a/icalBuddyFunctions.m
+++ b/icalBuddyFunctions.m
@@ -624,7 +624,7 @@ void filterCalendars(NSMutableArray *cals, AppOptions *opts)

 NSArray *getCalendars(AppOptions *opts)
 {
-    NSMutableArray *calendars = [[[[CALENDAR_STORE defaultCalendarStore] calendars] mutableCopy] autorelease];
+    NSMutableArray *calendars = [[[[[[CALENDAR_STORE alloc] init] autorelease] calendars] mutableCopy] autorelease];
     filterCalendars(calendars, opts);
     return calendars;
 }

None of which means anything to me, really.

Thanks! I've created the pull request: https://github.com/DavidKaluta/icalBuddy64/pull/3
It's out of our hands now :slight_smile:

2 Likes

Thanks! Here's hoping!

I tried version 1.10 and 1.10.1 and I still get the "no calendars" error. Does anyone have a working version of icalbuddy that works on Catalina 10.15.7?

This is the patched version that I am using, and it works on Catalina and Big Sur.

icalBuddyFixed.zip (54.1 KB)

2 Likes

Thanks! I tried it but still get no calendars. Is there something I should do with permissions?

BTW, it does work from the command line, but from KM, I get this:

Screen Shot 2020-11-04 at 7.07.08 PM

If it works from the command line then the permissions should be OK. You're 100% sure that you are using the same version in Keyboard Maestro that you are using on the command line, right? You might try renaming the version from Dropbox as "icalBuddyFixed" just to differentiate it from the one you can get from brew.

If it still does not work, we might need to ask Peter for assistance.

1 Like

Thanks. Very strange, can you try the dropbox link? I see a file with no extension called icalBuddy that isn't a text file and I can't figure out how to open it. (I can't tell if I was opening another file yesterday. Hmm.)

The icalBuddy file is an executable file, so you should just download it, make it executable (chmod 755 icalbuddy) and save it to /usr/local/bin/icalbuddy or /usr/local/bin/icalbuddyfixed

2 Likes

It worked. Thanks!

1 Like

Has anyone else encountered this kind of issue when using icalBuddy in KBM? I am using the patched version linked above (thanks, @tjluoma) and when I run it in the terminal, I get the desired output (for use in Obsidian with the Day Planner plugin):

- [ ] 08:00 Writing
- [ ] 09:00 Deep Work
- [ ] 10:00 Planning mtg
- [ ] 13:00 Weekly review

I am using these flags:

icalBuddy -b "- [ ] " -ea -nc -f -iep datetime,title -eed -po datetime,title -ps "| |" eventsToday

But when I use the same flags in KBM as "Execute shell script" and "paste results" into a text file, the output is really strange, including some non-printing characters:

e[22me[39me[49me[24me[25me[1m- [ ] e[33m08:00e[22me[39m e[33mWritinge[39m
e[1m- [ ] e[33m09:00e[22me[39m e[33mDeep Worke[39m
e[1m- [ ] e[33m10:00e[22me[39m e[33mPlanning mtge[39m
e[1m- [ ] e[33m13:00e[22me[39m e[33mWeekly review[39m

Is this an encoding issue? Any advice?

1 Like

Not an encoding issue. Those are ANSI escapes that are coming about because you are using the -f flag:

-f, --formatOutput
Use ANSI escape sequences to format the output and hopefully make it more readable.

Try removing the -f and see if it works better.

Also - welcome to the forums! It’s a great place on the web. Glad to have you with us.

1 Like

Brilliant! Removing the -f flag fixed it. Much appreciated.

1 Like

This fixed version appears to be broken again in MacOS Ventura.