Adding location information to calendar

Talk, speculate, discuss, pontificate. As long as it pertains to Hazel.

Moderators: Mr_Noodle, Moderators

Adding location information to calendar Thu Oct 29, 2015 1:42 pm • by laneyslaney
I am trying to figure out how I can add location information to calendar. I can use IFTTT to drop a file in a folder with my location in it such as when I visit a certain location. The bit I am missing is how I parse this file and have a script write a calendar entry. I have been hunting around to see how you might do this in a script. Tips?

What I am trying to do is ensure I get a calendar entry automatically added when I visit regular locations that I can claim expenses for. As there is no iCloud Calendar in IFTTT then I figure it must be possible to script it much like I can add entries to Day One (http://poor-signal.blogspot.de/2014/02/ ... ifttt.html)
laneyslaney
 
Posts: 2
Joined: Thu Oct 29, 2015 1:36 pm

Re: Adding location information to calendar Thu Oct 29, 2015 4:52 pm • by Mr_Noodle
I don't know the format of this file so it's hard to say. If you are familiar with shell scripting, you can try using "grep" or "sed" and "awk" but help on how to use these tools is a bit beyond these forums. I'd suggest looking at more general purpose shell scripting sites out there.
Mr_Noodle
Site Admin
 
Posts: 11236
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

I am familiar with *nix scripting. I can probably figure out how to parse and manipulate some text in a folder in BASH script to give me a vCal file in a drop box folder using sed, grep etc. This could trigger another flow in Hazel that did the import. It is the import into the calendar I am not sure where to start on which I think needs to be applescript? Other that I was thinking of it could be a program written in Java? I am not familiar with scripting apple mac applications.
laneyslaney
 
Posts: 2
Joined: Thu Oct 29, 2015 1:36 pm

Re: Adding location information to calendar Fri Oct 30, 2015 11:15 am • by Mr_Noodle
To import into Calendar, AppleScript would be your best bet. An alternative would be to write out to an ics file and open that with Calendar. Oh, and JavaScript can be used instead of AppleScript if you are on 10.10 or later. Something to consider if you are more familiar with JavaScript.
Mr_Noodle
Site Admin
 
Posts: 11236
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Open Discussion