Toggle Google Calendar Show/Hide in Apple Calendar

Does anyone know how to make it so I can toggle a calendar that shows up in Apple Calendar from a Google calendar I sync to it? Not sure if the Google calendar makes a difference or not. Here is an example of what I have so far that is not working.

tell application "Calendar"
    set calendarList to calendars
     for calendar in calendarList
        if calendar's name = "Work Appointments" then
            set visibility of calendar to not (calendar is visible)
            end if
    end for
end tell

Open in Script Editor

Perhaps the only way to do this is to use image and location clicking?