ali-rantakari / icalbuddy Goto Github PK
View Code? Open in Web Editor NEWCommand-line utility for printing events and tasks from the OS X calendar database.
Command-line utility for printing events and tasks from the OS X calendar database.
When providing iCalBuddy with a list of calendars to include with the -ic
flag, it appears to go through those calendars in alphabetical order. Is there a way to have it go through the calendars in the same order they were provided on the command line?
For example, icalBuddy -ic "calB, calA, calC"
will print out events in order from calA, then calB, then calC. Is there a way to keep the original ordering?
I believe it would be great to add support to icalBuddy to display the duration of each event. This would probably entail a command line option, which would display the duration next to the time range. This would be especially helpful for time-tracking use.
Hi Ali --I'd like to contact you via email but your website front page is 500. My email is in my profile when signed in to github. Could you please get in touch?
Cheers,
-zeek
Hi, I wonder if I'm seeing an issue similar to #24 at some layer. I'm running macOS Catalina on an i5-8259U. I installed icalBuddy but am running into an issue trying to call it in Terminal and iTerm:
zsh: bad CPU type in executable: icalBuddy
I looked a bit through Console and can't seem to spot anything for icalBuddy. Maybe I'm looking in the wrong place?
It works fine when running from terminal but I get error: No calendars. when running the command in apple script with do shell script "/usr/local/bin/icalBuddy eventsToday"
The Calendar Foundation Framework has been updated with 10.11 which now causes icalBuddy to throw this error:
icalBuddy[21258:108152] Error loading /System/Library/PrivateFrameworks/CalendarFoundation.framework/CalendarFoundation: dlopen(/System/Library/PrivateFrameworks/CalendarFoundation.framework/CalendarFoundation, 265): no suitable image found. Did find:
/System/Library/PrivateFrameworks/CalendarFoundation.framework/CalendarFoundation: mach-o, but wrong architecture
Hi, I just installed icalBuddy and when running icalBuddy calendars
from terminal on MacOS Catalina I get:
2019-06-16 00:59:50.732 icalBuddy[48349:511784] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'NSConcreteMutableAttributedString addAttribute:value:range:: nil value'
*** First throw call stack:
(
0 CoreFoundation 0x00007fff38f20c63 __exceptionPreprocess + 250
1 libobjc.A.dylib 0x00007fff6e3e906b objc_exception_throw + 48
2 Foundation 0x00007fff3b55fc87 +[NSPointerArray pointerArrayWithOptions:] + 0
3 icalBuddy 0x0000000101aed207 printAllCalendars + 569
4 icalBuddy 0x0000000101ae3842 main + 920
5 libdyld.dylib 0x00007fff6f7477a9 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
[1] 48349 abort icalBuddy calendars
I have not found anything regarding the formatting of all-day events in the manual, does anyone know if this is possible? There is just datetimeName & datetimeValue, that's all I could find for the formatting of the date.
1st-Awesome tool. THX for making it free!
Since updating to Sierra when running I get an error and I do get the output as well.
I pipe the results to a txt file, so I can email that to my wife, so I can't use the >/dev/null solution.
If you are still supporting this and it is an easy fix I appreciate the help, IF NOT, I get it! Thanks a lot for having provided this!
Here is the output
MacBook-Pro:mtgs-sms john$ /usr/local/bin/icalBuddy eventsToday
2016-10-14 09:25:32.619 icalBuddy[40228:3985212] Error loading /System/Library/PrivateFrameworks/CalendarFoundation.framework/CalendarFoundation: dlopen(/System/Library/PrivateFrameworks/CalendarFoundation.framework/CalendarFoundation, 265): no suitable image found. Did find:
/System/Library/PrivateFrameworks/CalendarFoundation.framework/CalendarFoundation: mach-o, but wrong architecture
• Chiro (Home)
9:20 AM - 10:20 AM
Issue:
icalBuddy displays wrong ending date for an all-day event beginning on the DST transition day (in the Eastern US timezone). OSX 10.10.
To Replicate:
In iCal / Calendar create an all-day event that begins on Nov 5 2017 and ends on Nov 11 2017. When icalBuddy is subsequently used to print the ending date for this event, it gives the incorrect ending date of Nov 10 2017. Digging deeper, if you ask icalBuddy to print the event using -df %c
, you'll see the ending date/time is "Fri Nov 10 23:00:00". This indicates that the DST correction is being incorrectly applied to the ending date (icalBuddy should print the ending date as "Sat Nov 11 00:00:00").
Possibly related to #3.
I have tried to use it with cron and with launchd in different configurations(as Daemon with sudo -u username in a script and with the defined user in a daemon configuration, and as the agent). I am still not able to figure out a workaround. Any ideas?
Is there a way to only show events in the near future that haven't already started? If I have an event that runs from 8:00am to 9:00am, and another event that starts at 10:00am and ends at 11:00am, I'd like to be able to run icalBuddy at 8:30am with a flag similar in behavior to the -n flag that would only show the second event, since the first has already started.
Using current version (1.8.8) I've been getting the following errors under Yosemite:
2014-11-27 18:01:12.846 icalBuddy[30650:3816422] Error loading /System/Library/PrivateFrameworks/CalendarFoundation.framework/CalendarFoundation: dlopen(/System/Library/PrivateFrameworks/CalendarFoundation.framework/CalendarFoundation, 265): no suitable image found. Did find:
/System/Library/PrivateFrameworks/CalendarFoundation.framework/CalendarFoundation: mach-o, but wrong architecture
It then goes on to produce the right information.
I upgraded OS X to Yosemite, and now I get the following error message when I try to run icalBuddy:
2014-10-18 12:03:05.666 icalBuddy[46273:103577] Error loading /System/Library/PrivateFrameworks/CalendarFoundation.framework/CalendarFoundation: dlopen(/System/Library/PrivateFrameworks/CalendarFoundation.framework/CalendarFoundation, 265): no suitable image found. Did find:
/System/Library/PrivateFrameworks/CalendarFoundation.framework/CalendarFoundation: mach-o, but wrong architecture
In researching the Calendar Store framework I ran across this Apple article:
https://developer.apple.com/library/mac/releasenotes/MacOSX/WhatsNewInOSX/Articles/MacOSX10_8.html
Note: The Calendar Store framework (CalendarStore.framework) is deprecated in OS X v10.8.
Use the Event Kit framework instead.
Your code compiles just fine (v1.8.8) still with no warnings, so this may not be an issue. I just wanted to bring it to your attention.
I use BusyCal to update my Google and Exchange calendars.
Both calendars are also synced to Mac OS X Calendar, but syncing only occurs when Mac OS X Calendar is open, and syncing is often unreliable.
Is it possible for icalBuddy to just read the BusyCal database directly instead?
Version: iCalBuddy 1.10.1 on macOS 11.2.1
icalBuddy -ic "calX" eventsFrom:2000 to:2030 | egrep "^• " | wc -l
egrep
with a RegEx that matches only event titles by matching a bullet character only at the very line start, and not bullets somewhere else in event attributes.wc -l
counts the occurence➜ ~ icalBuddy -ic "MyCal" eventsFrom:2019 to:2020 | egrep "^• " | wc -l
35
➜ ~ icalBuddy -ic "MyCal" eventsFrom:2000 to:2030 | egrep "^• " | wc -l
0 # How can that be? Maybe because it includes "too much future"?
➜ ~ icalBuddy -ic "MyCal" eventsFrom:2000 to:2020 | egrep "^• " | wc -l
0 # Another try. No more future. Still zero. Strange…
➜ ~ icalBuddy -ic "MyCal" eventsFrom:2010 to:2020 | egrep "^• " | wc -l
16 # Another try: Less past. Ok more.
# But still less than the 35 results for just 2019-2020
# which is just a subset of 2010-2020! Very strange!
➜ ~ icalBuddy -ic "MyCal" eventsFrom:2012 to:2020 | egrep "^• " | wc -l
9 # Ok seems plausible to get less if I narrow the range. (Ignoring the overall flaw ofc)
➜ ~ icalBuddy -ic "MyCal" eventsFrom:2011 to:2020 | egrep "^• " | wc -l
16 # Let's now step by step go further back into the past with "eventsFrom".
➜ ~ icalBuddy -ic "MyCal" eventsFrom:2010 to:2020 | egrep "^• " | wc -l
16
➜ ~ icalBuddy -ic "MyCal" eventsFrom:2009 to:2020 | egrep "^• " | wc -l
30 # Here it reaches it's maximum.
➜ ~ icalBuddy -ic "MyCal" eventsFrom:2008 to:2020 | egrep "^• " | wc -l
21 # And then it gets less, although I keep widening the range.
➜ ~ icalBuddy -ic "MyCal" eventsFrom:2007 to:2020 | egrep "^• " | wc -l
14 # Turns out the first event in this calendar was from 2009.
➜ ~ icalBuddy -ic "MyCal" eventsFrom:2006 to:2020 | egrep "^• " | wc -l
14 # The flawed logic seems to be: The more "emptiness your query range contains, the fewer results.
➜ ~ icalBuddy -ic "MyCal" eventsFrom:2005 to:2020 | egrep "^• " | wc -l
0 # Until being totally zero.
➜ ~ icalBuddy -ic "Test-iCalBuddy" eventsFrom:2010 to:2011
• Test 2011-04-05 (Test-iCalBuddy)
05.04.2011 at 10:00 - 11:00
# 3 events actually in sample calendar, but iCalBuddy lists only 1.
➜ ~ icalBuddy -ic "Test-iCalBuddy" eventsFrom:2010 to:2012
• Test 2011-04-05 (Test-iCalBuddy)
05.04.2011 at 10:00 - 11:00
# Extending range. Should yield 3, still only yields 1.
➜ ~ icalBuddy -ic "Test-iCalBuddy" eventsFrom:2010-01-01 to:2012-12-31 # More explicit syntax
• Test 2010-01-06 (Test-iCalBuddy)
06.01.2010 at 10:00 - 11:00
• Test 2010-03-03 (Test-iCalBuddy)
03.03.2010 at 11:00 - 12:00
• Test 2011-04-05 (Test-iCalBuddy)
05.04.2011 at 10:00 - 11:00
# More explicit syntax, more results. This one is correct for once.
➜ ~ icalBuddy -ic "Test-iCalBuddy" eventsFrom:2010-01-01 to:2020-12-31
• Test 2010-01-06 (Test-iCalBuddy)
06.01.2010 at 10:00 - 11:00
• Test 2010-03-03 (Test-iCalBuddy)
03.03.2010 at 11:00 - 12:00
• Test 2011-04-05 (Test-iCalBuddy)
05.04.2011 at 10:00 - 11:00
• Test 2013-04-09 (Test-iCalBuddy)
09.04.2013 at 10:00 - 11:00
# Extended range. Should yield 6 (even with roughest rounding), still only yields 4.
# Results from 2017 and 2018 are omitted, although in range.
Please make available via brew.
I tried to follow directions but I failed.
admin$ brew tap DavidKaluta/icalBuddy64 https://github.com/DavidKaluta/icalBuddy64
==> Tapping davidkaluta/icalbuddy64
Cloning into '/usr/local/Homebrew/Library/Taps/davidkaluta/homebrew-icalbuddy64'...
remote: Enumerating objects: 103, done.
remote: Counting objects: 100% (103/103), done.
remote: Compressing objects: 100% (95/95), done.
remote: Total 103 (delta 30), reused 44 (delta 8), pack-reused 0
Receiving objects: 100% (103/103), 230.08 KiB | 2.95 MiB/s, done.
Resolving deltas: 100% (30/30), done.
Tapped (118 files, 967.5KB).
admin$ brew install icalBuddy64
Error: No available formula with the name "icalbuddy64"
==> Searching for a previously deleted formula (in the last month)...
Error: No previously deleted formula found.
==> Searching for similarly named formulae...
Error: No similarly named formulae found.
==> Searching taps...
==> Searching taps on GitHub...
Error: No formulae found in taps.
I no longer have a python command since Apple removed its version 2 from Monterey 12.3 and the installer does not work now. I tried to just change the hashbang call to /usr/bin/python3 but there are some syntax errors in the script to be proccesses as Python3 (at least one print command without parenthesis):
File "/Users/xxx/Downloads/icalBuddy-v1.8.8/install.command", line 102
print red('Can not find file: ')+cyan(sourcepath)
^
SyntaxError: invalid syntax
There's a bug with the assumption that multi-day, all-day events' due date is 00:00 of the next day (e.g. an event spans from Monday to Wednesday is assumed to have the due date to be on Thursday at 00:00).
That is no longer the case in macOS 13. The due date for multi-day events are now set to be 23:59:59 on the due date. This causes icalBuddy to display one day shorter than the actual event. The same Monday-Wednesday calendar event is now rendered as Monday-Tuesday.
Trying to build the tarball, by cd'ing there and typing "make" on Yosemite with Xcode 6.1 results in the following:
---- Compiling main app:
======================================
clang -O3 -Wall -Wextra -Wno-unused-parameter -Werror -std=c99 -force_cpusubtype_ALL -mmacosx-version-min=10.5 -arch i386 -framework Cocoa -framework CalendarStore -framework AppKit -framework AddressBook -o icalBuddy icalBuddy.m icalBuddy[ABCDEFGHIJKLMNOPQRSTUVWXYZ]*.m ANSIEscapeHelper.m HG*.m IcalBuddy*.m *+HGAdditions.m
icalBuddyArgs.m:163:16: error: incompatible pointer types assigning to
'NSMutableDictionary *' from 'NSDictionary *'
[-Werror,-Wincompatible-pointer-types]
configDict = [NSDictionary dictionaryWithContentsOfFile:filePath];
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
make: *** [icalBuddy] Error 1
I suspect that the problem is due to the fact that reminders are no longer integrated into the MacOs calendar but don't know for sure. But when I create a and then run icalBuddy uncompletedTasks (or undatedUncompletedTasks) I get nothing back. Is there any way to fix this?
Note I am running icalBuddy in a terminal window for now and both the calendar and reminder privacy settings show that terminal.app has been given access. Displaying calendar data works just fine I am just not seeing any reminder data.
Although such a value exists for reminders, the due date printed for e.g. icalBuddy uncompletedTasks
doesn't contain a time value.
Is there a reason for this behavior?
Getting an error message on Warp terminal. https://www.warp.dev/
error: No calendars.
tried brew uninstall and install ; not able to make it work.
Pleae advise.
When I run icalBuddy eventsToday
in a restored tmux session it sometimes only outputs Error: No calendars.
Latest version installed via Homebrew, which for running a particular query:
/usr/local/bin/icalBuddy -eed -ea -n -nc -b "" -iep "datetime,title" -po "datetime,title" -ps "| - |" --strEncoding "Unicode (UTF-8)" -ic "[email protected]" eventsToday
The log outputs the following:
Dec 30 13:19:17 Voyager.local com.apple.time[254]: Interval maximum value is 946100000 seconds (specified value: 9223372036854775807).
Dec 30 13:19:17 Voyager.local secd[306]: securityd_xpc_dictionary_handler icalBuddy[52736] copy_matching The operation couldn’t be completed. (OSStatus error -34018 - client has neither application-identifier nor keychain-access-groups entitlements)
Dec 30 13:19:17 Voyager.local icalBuddy[52736]: SecOSStatusWith error:[-34018] The operation couldn’t be completed. (OSStatus error -34018 - Remote error : The operation couldn‚Äôt be completed. (OSStatus error -34018 - client has neither application-identifier nor keychain-access-groups entitlements))
Dec 30 13:19:17 Voyager.local secd[306]: securityd_xpc_dictionary_handler icalBuddy[52736] copy_matching The operation couldn’t be completed. (OSStatus error -34018 - client has neither application-identifier nor keychain-access-groups entitlements)
Dec 30 13:19:17 Voyager.local icalBuddy[52736]: SecOSStatusWith error:[-34018] The operation couldn’t be completed. (OSStatus error -34018 - Remote error : The operation couldn‚Äôt be completed. (OSStatus error -34018 - client has neither application-identifier nor keychain-access-groups entitlements))
Dec 30 13:19:17 Voyager.local secd[306]: securityd_xpc_dictionary_handler icalBuddy[52736] copy_matching The operation couldn’t be completed. (OSStatus error -34018 - client has neither application-identifier nor keychain-access-groups entitlements)
Dec 30 13:19:17 Voyager.local icalBuddy[52736]: SecOSStatusWith error:[-34018] The operation couldn’t be completed. (OSStatus error -34018 - Remote error : The operation couldn‚Äôt be completed. (OSStatus error -34018 - client has neither application-identifier nor keychain-access-groups entitlements))
Dec 30 13:19:17 Voyager.local secd[306]: securityd_xpc_dictionary_handler icalBuddy[52736] copy_matching The operation couldn’t be completed. (OSStatus error -34018 - client has neither application-identifier nor keychain-access-groups entitlements)
Dec 30 13:19:17 Voyager.local icalBuddy[52736]: SecOSStatusWith error:[-34018] The operation couldn’t be completed. (OSStatus error -34018 - Remote error : The operation couldn‚Äôt be completed. (OSStatus error -34018 - client has neither application-identifier nor keychain-access-groups entitlements))
Dec 30 13:19:17 Voyager.local secd[306]: securityd_xpc_dictionary_handler icalBuddy[52736] copy_matching The operation couldn’t be completed. (OSStatus error -34018 - client has neither application-identifier nor keychain-access-groups entitlements)
Dec 30 13:19:17 Voyager.local icalBuddy[52736]: SecOSStatusWith error:[-34018] The operation couldn’t be completed. (OSStatus error -34018 - Remote error : The operation couldn‚Äôt be completed. (OSStatus error -34018 - client has neither application-identifier nor keychain-access-groups entitlements))
Dec 30 13:19:17 Voyager.local secd[306]: securityd_xpc_dictionary_handler icalBuddy[52736] copy_matching The operation couldn’t be completed. (OSStatus error -34018 - client has neither application-identifier nor keychain-access-groups entitlements)
Dec 30 13:19:17 Voyager.local icalBuddy[52736]: SecOSStatusWith error:[-34018] The operation couldn’t be completed. (OSStatus error -34018 - Remote error : The operation couldn‚Äôt be completed. (OSStatus error -34018 - client has neither application-identifier nor keychain-access-groups entitlements))
Dec 30 13:19:17 Voyager.local secd[306]: securityd_xpc_dictionary_handler icalBuddy[52736] copy_matching The operation couldn’t be completed. (OSStatus error -34018 - client has neither application-identifier nor keychain-access-groups entitlements)
Dec 30 13:19:17 Voyager.local icalBuddy[52736]: SecOSStatusWith error:[-34018] The operation couldn’t be completed. (OSStatus error -34018 - Remote error : The operation couldn‚Äôt be completed. (OSStatus error -34018 - client has neither application-identifier nor keychain-access-groups entitlements))
Dec 30 13:19:17 Voyager.local secd[306]: securityd_xpc_dictionary_handler icalBuddy[52736] copy_matching The operation couldn’t be completed. (OSStatus error -34018 - client has neither application-identifier nor keychain-access-groups entitlements)
Dec 30 13:19:17 Voyager.local icalBuddy[52736]: SecOSStatusWith error:[-34018] The operation couldn’t be completed. (OSStatus error -34018 - Remote error : The operation couldn‚Äôt be completed. (OSStatus error -34018 - client has neither application-identifier nor keychain-access-groups entitlements))
Seems similar to/related to:
https://gist.github.com/hjuutilainen/7544223
I have a quick question about iCalBuddy I couldn’t find a response for in the docs
I have icalbuddy installed in /usr/local/bin and it works flawlessly from command line:
/usr/local/bin/icalBuddy -ea -tf "%H:%M" -b "" -li 4 -n -eed -npn -nc -ps "/ | /" -eep "location,notes,attendees” eventsToday
When I first ran it, if I recall, it asked me to give it access to my calendars which I did. No problem here. This is on Mavericks by the way.
However when I run it from the cron, I see this error in the system.log:
Jul 18 09:37:34 EDASQUEMAC1 icalBuddy[47140]: SecOSStatusWith error:[-34018] The operation couldn’t be completed. (OSStatus error -34018 - Remote error : The operation couldn‚Äôt be completed. (OSStatus error -34018 - client has neither application-identifier nor keychain-access-groups entitlements))
In the error stream for iCalBuddy I see:
2014-07-18 09:14:01.632 icalBuddy[38807:d07] * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '* +[CalCalendarStore eventPredicateWithStartDate:endDate:calendars:]: calendars is nil'
*** Call stack at first throw:
(
0 CoreFoundation 0x96274471 __raiseError + 193
1 libobjc.A.dylib 0x909b8091 objc_exception_throw + 162
2 CoreFoundation 0x9627438b +[NSException raise:format:] + 139
3 CalendarStore 0x0002b5e6 +[CalCalendarStore eventPredicateWithStartDate:endDate:calendars:] + 260
4 icalBuddy 0x00005f93 getEvents + 611
5 icalBuddy 0x0000624c getCalItems + 172
6 icalBuddy 0x00002609 main + 1257
7 icalBuddy 0x00002075 start + 53
)
It seems that iCalBuddy when ran from cron from the same user requires some permission that it doesn’t have. Any idea on how to fix this?
Mojave introduces stricter privacy controls and icalBuddy sigterms when being used on iTerm2.
To reproduce:
Result:
/usr/local/bin/icalBuddy calendars
[1] 2038 abort /usr/local/bin/icalBuddy calendars
On regular Terminal the above works. Not sure if iTerm2 requires some specific handling to support this. I logged iTerm2 issue as well.
First, thanks for the very useful util!
I'm getting the following error when running under OS X Yosemite. STDOUT has everything I need and I'll mention that you can work around the error in most circumstances in case it helps anybody.
Error:
2015-05-20 15:20:12.294 icalBuddy[84684:13851007] Error loading /System/Library/PrivateFrameworks/CalendarFoundation.framework/CalendarFoundation: dlopen(/System/Library/PrivateFrameworks/CalendarFoundation.framework/CalendarFoundation, 265): no suitable image found. Did find:
/System/Library/PrivateFrameworks/CalendarFoundation.framework/CalendarFoundation: mach-o, but wrong architecture
Work around:
$ /usr/local/bin/icalBuddy 2&> /dev/null
There are a lot of "maybe" events on my calendar. Is there any way to filter out only the ones i've explicitly set to "accepted" ?
In case I don't miss something obvious, the only way to get dates in your local time zone is by using %X
and %x
or utilize %z
to calculate the local time yourself.
The latter is a bit inconvenient and the former won't allow you to use your own date/time formatting. Additionally, %X %x
are not correct for me^1 (although %z
shows the correct time zone offset).
Is it somehow possible to format a date/time yourself, while using local time values by e.g. specifying a timezone beforehand? icalBuddyPrettyPrint.m#L238 passes nil
as timezone, but I don't know if that's the only relevant place.
^1 My %z
value is currently +0100
, but the time printed from both, %X
and %H
is the same (which is, of course, 1h less than it should)
Any way to get the organizer of the event?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.