Chatting with my Calendar
How I use Apple Shortcuts and OpenAI's gpt-4.1 to do one complex administrative task
One of the most cumbersome things for me, is consulting with my calendar.
I get a lot of emails like this:
”Are you free to meet on the following days and times” with some suggestions.
The next steps for me feels like 4D Tetris. I look at my work calendar, then family calendar, then see OK since I usually am scheduled, what can move?
No one can really look at my calendar and infer what is possible. And I’ve always wished for ChatGPT or Microsoft Copilot to do this - but that requires having access to all my calendars and the only device that has this knowledge is my iPhone.
So I built a solution to this using Apple Shortcuts, OpenAI’s APIs and a Shortcuts app called AI Actions from developer Sindre Sorhus. Sindre is a prolific indie developer who has built tons of amazing apps and utilities, many of which I use.
What is Apple Shortcuts? It’s a very powerful way to build mini apps or automatons on your iPhone, iPad or Mac. I have hundreds of them to do all sorts of useful little things that make my life a littler bit better. It’s also the foundation for how Apple will be exposing its on-device foundation models to end users like me when they release iOS 26.
What is AI Actions? It’s a simple proxy between Apple Shorcuts and OpenAI and Anthropic. It enables you to use LLMs in Apple Shorcuts as an extension of what Shortcuts Provide. AI Actions does not have any UI other than a place to enter in your API Keys from OpenAI or Anthropic.
When you open Apple Shortcuts though and start to interact with it you’ll see what you can do:
As you can see, you simply provide your prompt, system prompt, pick your model (I generally use gpt-4.1 for all my shortcuts) and then I usually set the temperature to something low (temperature is how creative you want the model to be).
So, let’s get into my shortcut. Here is how it works:
First build a list of all calendar events that are “potential openings”. I have the following list: ["lunch","hard stop","focus time","travel to work"]. These are permissible times to schedule over.
Then set parameters for start / end time to look. 8:00 to 17:00 hours.
Now ask me, what date range I want to look for availability. I have this set to:
Now we use the local Find Calendar events to build a list of all my events from two of my calendars, Microsoft and Family.
We create a JSON array out of this.
Now we create our first prompt for OpenAI gpt-4.1:
Find open time slots in my calendar.
# Instructions
Working Hours
start: [StartTime]
end: [EndTime]
timezone: [TimeZone]
Ignore Titles
[IgnoreTitles]
# Constraints
1. FIRST, **remove** all ignored events from consideration (they may remain as free time).
2. SECOND, on the remaining (non-ignored) events, sort by start time and merge any two where
`next.start ≤ previous.end + MinSlotLength minutes` into one busy block.
3. THIRD, compute the free intervals between StartTime and EndTime that are **not** covered by these merged busy blocks.
4. FOURTH, discard any free interval shorter than 25 minutes.
5. LAST, output **only** the resulting RFC 8259 JSON array (no comments, no trailing commas).
# Example Output
[
{
"date": "YYYY-MM-DD",
"slots": [
{ "start": "HH:MM", "end": "HH:MM" },
...
]
}
]
# Input
[JsonArray]
Now we call OpenAI with the prompt and get back a result
Now this returns a JSON Array of events that are “open” and looks like this:
[
{
"date": "2025-06-17",
"slots": [
{ "start": "08:00", "end": "12:05" },
{ "start": "12:30", "end": "13:40" },
{ "start": "15:30", "end": "16:30" }
]
},
{
"date": "2025-06-19",
"slots": [
{ "start": "08:00", "end": "09:05" },
{ "start": "10:30", "end": "17:00" }
]
},
{
"date": "2025-06-20",
"slots": [
{ "start": "08:00", "end": "09:05" },
{ "start": "09:30", "end": "12:30" },
{ "start": "13:30", "end": "17:00" }
]
}
]
Since this is not human readable we now call OpenAI gpt-4.1 again with a new prompt to turn this into something that you can read.
Here is the second prompt:
You are an AI scheduling assistant.
# Instructions
Please summarize my calendar availability based on the following calendar data.
Be sure to specify that all times are in Pacific Daylight Time (PDT)
Your response should:
- Briefly explain that these are my open time slots.
- List each date with its available time ranges in a clear, reader-friendly format.
- use AM/PM and NOT 24H Format.
# Input:
[
{
"date": "2025-06-17",
"slots": [
{ "start": "08:00", "end": "12:05" },
{ "start": "12:30", "end": "13:40" },
{ "start": "15:30", "end": "16:30" }
]
},
{
"date": "2025-06-19",
"slots": [
{ "start": "08:00", "end": "09:05" },
{ "start": "10:30", "end": "17:00" }
]
},
{
"date": "2025-06-20",
"slots": [
{ "start": "08:00", "end": "09:05" },
{ "start": "09:30", "end": "12:30" },
{ "start": "13:30", "end": "17:00" }
]
}
]
Now we use Ask AI Again:
And here is the result:
Here are your available time slots, all in Pacific Daylight Time (PDT):
**June 17, 2025**
- 8:00 AM – 12:05 PM
- 12:30 PM – 1:40 PM
- 3:30 PM – 4:30 PM
**June 19, 2025**
- 8:00 AM – 9:05 AM
- 10:30 AM – 5:00 PM
**June 20, 2025**
- 8:00 AM – 9:05 AM
- 9:30 AM – 12:30 PM
- 1:30 PM – 5:00 PM
These are your open time slots for scheduling.
Hope you can see the power of using chained prompts this way.
Here is a quick video demonstrating this working:
Requirements
As mentioned you need:
Summary
We used Apple Shortcuts and OpenAI gpt-41. in a multi chained prompt to figure out when there is availability in your calendar for a meeting.
This demonstrates how to use an LLM with your local calendar data on iOS or macOS.
I hope you can see the power of combining Shortcuts with local data and an LLM.
You can download the shortcut here. I’m sure it’s got bugs!
Also if you are reading this for the first time, consider subscribing!
Cool use of AI. For this task, I like to use a service that, instead of me presenting options, I just manage my calendar, and the recipient finds a time that works. For this, I use SavvyCal (http://aconn.me/savvycal). I've connected multiple calendars to it (most M365, some Google). Then I have different scheduling links.
For instance, coaching clients get lots of access, I only take sales calls on certain days of the week, and others are rate limiting, fixed durations (15/25/45 minute calls) or have automatic gaps added between blocks.
I just sent a link, and when they try to find time, they can optionally connect their calendar (Google/M365/Outlook) to find mutual availability and request a meeting. My availability is always shown as a union of all my calendars, and it's always live.