Add a Calendar Entry

Hi all,

I have been looking around for a solution, but I was not able to find one. Hence, I am trying this way.
I have the following problem to solve:

On a regular basis, I send out an mail with a specific notice period. Now, I would like to add the calculated notice period to my calendar and create a reminder on that date. Is that possible? Does anyone have an idea?

I am using @JMichaelTX Date Calculation to calculate the notice period. That is set as "%Variable%Local__NewDate%" in KM.

Now, I want to use that date to create a calendar entry with some fixed or variable inputs. The "Make team calendars Marco" (Make Team Calendars Macro) did not help me unfortunately.

Any solutions how to tackle this issue? I am not good at Apple Script, but from what I read it will be the best solution? I am flexibel in using the native Calendar app, or Fantastical.

Bests and thanks for your help.

Michael

there was a Podcast were they talked about this, here:

you might find this video useful:

Numbers and Fantastical for Batch Event Creation [Screencast]
1 Like

Thanks, I have seen that one as well, but it was not helpful for me purpose. I want to have it with keyboard maestro.

Maybe as an update for anyone else interested: I have been working on it and after many errors, I have created the following apple script that works for me:

set eventtitle to system attribute "KMVAR_local__docnumber"
set eventURL to system attribute "KMVAR_local__calurl"
set eventDescription to system attribute "KMVAR_local__calnote"
set x to system attribute "KMVAR_Local__AdjustBy"
set theStartDate to (current date) + (x * days)
set hours of theStartDate to 18
set minutes of theStartDate to 0
set seconds of theStartDate to 0
set theEndDate to theStartDate + (60 * minutes)

tell application "Calendar"
	tell calendar "Test"
		set newEvent to make new event with properties {summary:"DUE " & eventtitle, start date:theStartDate, end date:theEndDate, description:eventDescription, url:eventURL}
	end tell
end tell

That works for me and creates an entry on that day. Somehow the reminder does not work on Apple Script. If any one has a solution for that, I would be more than happy to hear about it.

1 Like

Hi @michael_e,

I thought you were asking for setting an alert for the calendar. I was not able to do that either.
I do have a macro that creates a new event on my calendar.
The default alert time for my calendar is 30min before the event begins. I'm also looking for a way to set a custom alert.
Calendar_New Event.kmmacros (8.2 KB)

image

The prompt window is like this:
image

1 Like

Thanks for the feedback. I will look into it.

On the reminder: I was able to fix that issue:

set newEvent to make new event with properties {summary:"FA " & eventtitle, start date:theStartDate, end date:theEndDate, description:eventDescription, url:eventURL}

-- Add a message alarm

tell newEvent

make new sound alarm at end of sound alarms with properties {trigger interval:0, sound name:"Sosumi"}

end tell

That adds a notification, even though the scripts says sound. If you remove that part, it is not setting a reminder.

FYI, something beautiful with that script: "trigger interval:0" means at the time of the event, you will be notified. If -30 it will be 30min before, if +60 it will be 60 minutes after the event. That's great for a reminder after the meeting, for example if you have to check something.

Hope that helps. For me the tricky part was to find "KMVAR_" to use for apple script.

Ah. Thanks! I did across this before. But I thought it was not what I was looking for and did not try. I tried the display alarm in AppleScript and it did not work...

Thanks for this. I have frequent appointments where the organizer sets it as an all day event, and, for reminders and my availability, I need to turn them into actual start time/end time events. This macro is going to be immensely helpful in that.

2 Likes