Jump to content

Open Conference URL - Launch the Zoom/Meet call for your next calendar event


Recommended Posts

With the "new normal", many of us are working from home and jumping from one virtual meeting to the next to the next: from Zoom to Google Meet to GoToMeeting, etc. To save the pain of scrambling to open your next meeting link, I have written a workflow just for that!

 

It's called "Open Conference URL", and its usage is simple: type conf to see your upcoming calendar events. Hit Enter to launch Zoom/Meet/etc. immediately. And even if you are 15 minutes late, the workflow will know what to do. (Download Workflow)

 

screenshot.png.14661d01437ed11cc74517a66867043a.png

If there are no nearby calendar events, the workflow displays all events for today:

 

screenshot-noresults.png.9fa32e1731a641476eeaa6d49e4141ee.png

Download Workflow

 

For documentation on all the configurable preferences, see the project's GitHub page: https://github.com/caleb531/open-conference-url

Link to comment

I'm getting an error in cache.py:

 

  File "ocu/cache.py", line 42, in __init__
    self.refresh()
  File "ocu/cache.py", line 110, in refresh
    if self.get('event_blobs') != event_blobs:
  File "ocu/cache.py", line 77, in get
    return self.__dict__[key]
KeyError: u'event_blobs'

 

You’re using dict incorrectly. dict[key] always throws a KeyError if a key doesn’t exist.

 

    # Return True if the given key exists in the cache; otherwise, return false
    def has(self, key):
        if self.__dict__[key]:
            return True
        else:
            return False

    # Return True if the given key exists in the cache; otherwise, return false
    def get(self, key):
        return self.__dict__[key]

 

I think you mean to be using self.__dict__.has_key() and self.__dict__.get()? If you’re going to store data in __dict__, you might as well inherit from dict instead of object.

 

It's not a good idea to store user preferences in the workflow's own folder: they'll get overwritten by a workflow update. If you can't or don't want to store them in info.plist as workflow environment variables, put them in the workflow's data directory.

Link to comment
On 11/22/2020 at 11:46 PM, deanishe said:

I think you mean to be using self.__dict__.has_key() and self.__dict__.get()? If you’re going to store data in __dict__, you might as well inherit from dict instead of object.

 

Im having exactly this error, i'm just a rookie developer and tried this change you mention but still does not work for me, could you lend a hand?
 

    from ocu.cache import cache
  File "ocu/cache.py", line 130, in <module>
    cache = Cache()
  File "ocu/cache.py", line 42, in __init__
    self.refresh()
  File "ocu/cache.py", line 110, in refresh
    if self.get('event_blobs') != event_blobs:
  File "ocu/cache.py", line 77, in get
    return self.__dict__.get([key])
TypeError: unhashable type: 'list'

 

Link to comment
  • 3 weeks later...
  • 2 weeks later...
  • 3 weeks later...

Yeah it looks like the version that's current on master branch on github works great! BUT the most recent packaged version, v2.0.1 is broken.

 

@caleb531 If you release the current state of the master branch it'll fix this issue! But v2.0.1 throws an error and fails bc of the issue identified above (self.get() in cache.py is broken, it throws a KeyError bc neither it nor has() actually safely check whether the key exists)

 

Also btw... this workflow is EXTREMELY cool, thank you for building it!!

Link to comment
  • 8 months later...

So glad you made this one Dean. If Alfred has access to the calendars, do you need to separately allow the workflow access to calendar? No prompt has come up, and the workflow isn't pulling up any upcoming meetings even after tweaking the event across different calendars and adjusting the config. 

Link to comment
On 9/21/2021 at 11:09 PM, bazerman said:

If Alfred has access to the calendars, do you need to separately allow the workflow access to calendar?

 

I don’t think so, no. If it isn’t working, please check Alfred’s workflow debugger and the log file (enter .vc workflow:openlog into Alfred) for an error message.

 

Link to comment

Thanks Dean - it looks like it's finding my calendar events but not picking up any of the conference URLs

 

:39:02 video-conferences.py:65 DEBUG    max_cache_age=300

14:39:02 video-conferences.py:67 DEBUG    lookahead_days=5

14:39:02 video-conferences.py:82 DEBUG    regex=https://teams\.live\.com/meet/[a-z0-9]+

14:39:02 video-conferences.py:82 DEBUG    regex=https://([a-z0-9]+\.)?zoom\.us/j/\d+(\?pwd=[a-z0-9]+)?

14:39:02 video-conferences.py:82 DEBUG    regex=https://meet\.google\.com/[a-z-]+

14:39:02 video-conferences.py:82 DEBUG    regex=https://[a-z0-9]+\.zoom\.us/[a-z0-9_.-]+/\d+\?pwd=[a-z0-9]+

14:39:02 video-conferences.py:76 DEBUG    calendar='Default'

14:39:02 video-conferences.py:82 DEBUG    regex=https://([a-z0-9]+\.)?zoom\.us/j/\d+(\?pwd=[a-z0-9]+)?

14:39:02 video-conferences.py:82 DEBUG    regex=https://meet\.lync\.com/[a-z0-9_.-]+/[a-z0-9_.-]+/[a-z0-9]+

14:39:02 video-conferences.py:82 DEBUG    regex=https://teams\.microsoft\.com/l/meetup-join/[a-zA-Z0-9/%?&=._-]+

14:39:02 workflow.py:1695 DEBUG    loading cached data: /Users/name/Library/Caches/com.runningwithcrayons.Alfred/Workflow Data/net.deanishe.alfred.video-conferences/events.cpickle

14:39:02 video-conferences.py:245 DEBUG    0/90 event(s) in specified accounts & calendars are video conferences

14:39:02 workflow.py:1468 DEBUG    reading settings from /Users/name/Library/Application Support/Alfred/Workflow Data/net.deanishe.alfred.video-conferences/settings.json

Link to comment

That doesn’t tell me anything, I'm afraid. That looks like the debugger output. Look in the log file (type .vc workflow:openlog into Alfred). Calendar events are fetched by a background job, so there’s no output in the debugger. Use .vc reload to force the workflow to reload your events from Calendar.app.

 

If there's no info in there, then please post details of one of your events that the workflow isn't finding.

Link to comment
  • 1 year later...

Great workflow, thanks!

One feedback on my side: it would be great to be able to filter the conferences shown by selecting the calendar - as I am using separate calendars for work, private, events, etc., I wish to be able to select only the work one for the workflow.

Link to comment
  • 2 months later...
On 11/26/2020 at 3:56 AM, JuanDz said:
TypeError: unhashable type: 'list'

TypeError: unhashable type: 'list' usually means that you are trying to use a list as an hash argument. This means that when you try to hash an unhashable object it will result an error. 

 

For ex. when you use a list as a key in the dictionary , this cannot be done because lists can't be hashed. The standard way to solve this issue is to cast a list to a tuple . So, in order to fix unhashable type: 'list', you'll have to change your list into tuples if you want to put them as keys in your dictionary .

 

my_dict = {'name': 'John', tuple([1,2,3]):'values'}
print(my_dict)

 

The hash() is a built-in python method, used to return a unique number . This can be applied to any user-defined object which won’t get changed once initialized. This property is used mainly in dictionary keys .

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...