16

I have iCal and Google Calendar synced so that I can see my appointments. However, I am never able to see the Google Hangout link unless I go to google calendar.

Do any native OSX apps support the field for the Google Hangout link?

Brett Hardin
  • 4,012
  • 2
  • 19
  • 22

2 Answers2

9

Thanks to nempnett's little script, I finally managed to automate it all into a tool now on GitHub. I've written about it here : http://yeraze.com/a-better-way-to-fix-osx-calendar-google-hangouts

You'll have to do a bit of terminal magic, but then it will sync your Google Hangout links into the Calendar URL fields automatically.

Yeraze
  • 3,269
  • 4
  • 28
  • 42
5

This has annoyed me for ages. I have two solutions below. One that will allow you to easily launch a hangout from the iCal event the other updates the iCal event with the hangout details.

  1. Create an Automator of type application
  2. Add 'GetSpecified Finder' Items step
  3. Add a 'Run Shell Script' step (change the Shell Script block to accept input "As Arguments")
  4. Copy the following into the text box:

    read url <<< $(cat "$1" | sed "s/$(printf '\r')\$//" | awk -F':' '/X-GOOGLE-HANGOUT/ {first = $2":"$3; getline rest; print (first)(substr(rest,2)); exit 1}';)
    open "$url"
    
  5. Save the Application and add to your dock

Now you will be able to just drag an event onto the dock item and it will parse the .ics file and launch the Hangout in your default browser.

UPDATE: Extended the above to update the calendar entry to add hangout as URL in event:

  1. Create an Automator of type application
  2. Add 'GetSpecified Finder' Items step
  3. Add a 'Run Shell Script' step (change the Shell Script block to accept input "As Arguments")
  4. Copy the following into the text box:

    read url <<< $(cat "$1" | sed "s/$(printf '\r')\$//" | awk -F':' '/X-GOOGLE-HANGOUT/ {first = $2":"$3; getline rest; print (first)(substr(rest,2)); exit 1}';)
    read uid <<< $(cat "$1" | sed "s/$(printf '\r')\$//" | awk -F':' '/UID/ {print $2; exit 1}';)
    echo "$url"
    echo "$uid"
    
  5. Add a step of type 'Run Apple Script'
  6. Copy the following into the box replacing "myCalendar" with the name of your calendar:

    on run {input, parameters}
    set myURL to input's item 1
    set myUID to input's item 2
    set myCal to "myCalendar"
    
    tell application "Calendar"
    tell calendar myCal
        set theEvent to first event whose uid = myUID
        set (url of theEvent) to myURL
    end tell
    end tell
    return input
    end run 
    
  7. Save the Application and add to your dock

Now when you drag an event onto your dock icon it will update the event by adding the hangout URL to the event.

Taking the above as a start it would be good if someone wanted to do a scheduled batch processing update of the entire calendar that runs every morning say...

nempnett
  • 225
  • 2
  • 7
  • I just got this to work.. I did have to change the Shell Script block to accept input "As Arguments", where it defaulted to "As Stdin". – Yeraze Nov 18 '13 at 21:36
  • Thanks @Yeraze - I had that set in my automator but missed it in the instructions above - I've updated to call this out now. – nempnett Nov 27 '13 at 20:21
  • Ever have any luck with bulk processing? I tried using the new automator features to do "Batch Processing", but it didn't seem to work. It's easy to make an automator task to grab all of today's events, and then kick off another workflow for each one. Just couldn't figure out how to make it pass the data in the way you're expecting (the Terminal awk stuff). – Yeraze Nov 27 '13 at 22:19
  • The problem is that calendar app has no way to automate getting at the ical file of the individual events which is what you need to have be able to run the file parsing to extract the hangout data. The only batch way I could see is to export the whole calendar as an ics. Parse the entire thing and write back the relevant events (probably by having to reimport the updated ics file I expect). That always seemed a bit overkill (and likely prone to screwing up the entire calendar!) so I didn't pursue it. I've got into the habit of just dragging new events on to the above tool before I accept. – nempnett Dec 09 '13 at 18:49
  • I succeeded at writing a Python + applescript tool that could batch update everything a some distance in the future (I used 2 weeks) with a URL to the HAngout link, and it worked great. Unfortunately, OSX would immediately revert the change back to the remote copy, undoing the change in seconds. Something about the way you're dragging calendar events out for processing, causes local ICS files to be created, disconnecting them from their remote copies. – Yeraze Dec 23 '13 at 05:28