Jump to content

Workflow to get next meeting location/url and open it


Recommended Posts

There's not some setting you can change, no.

 

The workflow script just extracts some text from calendar events that matches the regular expressions it has been given. It neither knows nor cares if they're URLs.

 

If you add zoommtg: URLs to your meetings instead of https: ones, and add an appropriate regex to the workflow, it will extract those URLs and they’ll open directly in Zoom.

 

Alternatively, you could edit the branch of the workflow that opens the URL to check for "zoom.us/" in the URL and open the URL in the Zoom app, instead of your default browser, if found.

Edited by deanishe
Link to comment
  • 1 month later...
  • 2 weeks later...
  • 2 weeks later...
  • 3 weeks later...

Hey @deanishe Thanks for making an amazing workflow. I don't know python so I'm having trouble configuring the names of calendars to limit the search to. Can you help provide an example of the syntax needed? 

 

Specifically: CALENDARS = set()  # names of calendars to search

 

I have a lot of calendars, but I only want your workflow to show a calendar called "Joe @ Work". How do I set that up? I wasn't clear if I also needed to define calendar_1, calendar_2, etc. 

 

 

Thank you 

Link to comment
6 minutes ago, deanishe said:


You only need to set the variables in the workflow config sheet, not edit any code.

 

Clearly, I'm new to workflows. Thank you 

 

For any other noobs, go to the workflow in Alfred and click the [𝑥] icon for settings.

Link to comment
  • 9 months later...
  • 2 weeks later...
  • 2 months later...

I installed the updated version from here that is supposed to be compatible with Python 3, but get the following error:
 

[08:25:03.542] ERROR: Video Conferences[Script Filter] Code 1: Traceback (most recent call last):
  File "/Users/kai/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.CEAADCE6-17EA-42AB-B49E-9895D8DE7564/./video-conferences.py", line 43, in <module>
    from workflow import Workflow3, ICON_INFO, ICON_WARNING
  File "/Users/kai/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.CEAADCE6-17EA-42AB-B49E-9895D8DE7564/workflow/__init__.py", line 16, in <module>
    from .workflow import Workflow, manager
  File "/Users/kai/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.CEAADCE6-17EA-42AB-B49E-9895D8DE7564/workflow/workflow.py", line 25, in <module>
    import cPickle
ModuleNotFoundError: No module named 'cPickle'


I tried changing the relevant import to `import pickle as cPickle` which then gives me a very similar error
 

[08:32:28.693] ERROR: Video Conferences[Script Filter] Code 1: Traceback (most recent call last):
  File "/Users/kai/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.CEAADCE6-17EA-42AB-B49E-9895D8DE7564/./video-conferences.py", line 43, in <module>
    from workflow import Workflow3, ICON_INFO, ICON_WARNING
  File "/Users/kai/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.CEAADCE6-17EA-42AB-B49E-9895D8DE7564/workflow/__init__.py", line 16, in <module>
    from .workflow import Workflow, manager
  File "/Users/kai/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.CEAADCE6-17EA-42AB-B49E-9895D8DE7564/workflow/workflow.py", line 47, in <module>
    from util import AcquisitionError  # noqa: F401
ModuleNotFoundError: No module named 'util'


I tried changing this to `from .util import <rest of statement>` based on some SO suggestion. That then gives me:
 

[08:33:58.014] ERROR: Video Conferences[Script Filter] Code 1: Traceback (most recent call last):
  File "/Users/kai/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.CEAADCE6-17EA-42AB-B49E-9895D8DE7564/./video-conferences.py", line 278, in <module>
    log = wf.logger
  File "/Users/kai/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.CEAADCE6-17EA-42AB-B49E-9895D8DE7564/workflow/workflow.py", line 1410, in logger
    self.logfile,
  File "/Users/kai/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.CEAADCE6-17EA-42AB-B49E-9895D8DE7564/workflow/workflow.py", line 1379, in logfile
    return self.cachefile('%s.log' % self.bundleid)
  File "/Users/kai/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.CEAADCE6-17EA-42AB-B49E-9895D8DE7564/workflow/workflow.py", line 1100, in bundleid
    if self.alfred_env.get('workflow_bundleid'):
  File "/Users/kai/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.CEAADCE6-17EA-42AB-B49E-9895D8DE7564/workflow/workflow.py", line 1076, in alfred_env
    value = self.decode(value)
  File "/Users/kai/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.CEAADCE6-17EA-42AB-B49E-9895D8DE7564/workflow/workflow.py", line 2700, in decode
    if not isinstance(text, unicode):
NameError: name 'unicode' is not defined


Since I'm not a Python developer I'm completely clueless about how to debug this. Any advice?

I also tried installing Python 2 and using that binary to run the script, which spits out this:

 

[08:33:58.014] ERROR: Video Conferences[Script Filter] Code 1: Traceback (most recent call last):
  File "/Users/kai/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.CEAADCE6-17EA-42AB-B49E-9895D8DE7564/./video-conferences.py", line 278, in <module>
    log = wf.logger
  File "/Users/kai/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.CEAADCE6-17EA-42AB-B49E-9895D8DE7564/workflow/workflow.py", line 1410, in logger
    self.logfile,
  File "/Users/kai/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.CEAADCE6-17EA-42AB-B49E-9895D8DE7564/workflow/workflow.py", line 1379, in logfile
    return self.cachefile('%s.log' % self.bundleid)
  File "/Users/kai/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.CEAADCE6-17EA-42AB-B49E-9895D8DE7564/workflow/workflow.py", line 1100, in bundleid
    if self.alfred_env.get('workflow_bundleid'):
  File "/Users/kai/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.CEAADCE6-17EA-42AB-B49E-9895D8DE7564/workflow/workflow.py", line 1076, in alfred_env
    value = self.decode(value)
  File "/Users/kai/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.CEAADCE6-17EA-42AB-B49E-9895D8DE7564/workflow/workflow.py", line 2700, in decode
    if not isinstance(text, unicode):
NameError: name 'unicode' is not defined
[08:37:16.088] Video Conferences[Script Filter] Queuing argument '(null)'
[08:37:16.358] Video Conferences[Script Filter] Script with argv '(null)' finished
[08:37:16.359] STDERR: Video Conferences[Script Filter] .
08:37:16 workflow.py:2061 DEBUG    ---------- Video Conferences (0.1.4) ----------
08:37:16 video-conferences.py:196 DEBUG    args={'--calendar': None,
 '--event': None,
 '--force-reload': False,
 '--help': False,
 '--notify': False,
 '--reload': False,
 '<query>': u''}
08:37:16 video-conferences.py:65 DEBUG    max_cache_age=300
08:37:16 video-conferences.py:67 DEBUG    lookahead_days=3
08:37:16 video-conferences.py:82 DEBUG    regex=https://teams\.live\.com/meet/[a-z0-9]+
08:37:16 video-conferences.py:82 DEBUG    regex=https://meet\.google\.com/[a-z-]+
08:37:16 video-conferences.py:82 DEBUG    regex=https://[a-z0-9]+\.zoom\.us/[a-z0-9_.-]+/\d+\?pwd=[a-z0-9]+
08:37:16 video-conferences.py:82 DEBUG    regex=https://([a-z0-9]+\.)?zoom\.us/j/\d+(\?pwd=[a-z0-9]+)?
08:37:16 video-conferences.py:82 DEBUG    regex=https://meet\.lync\.com/[a-z0-9_.-]+/[a-z0-9_.-]+/[a-z0-9]+
08:37:16 video-conferences.py:82 DEBUG    regex=https://teams\.microsoft\.com/l/meetup-join/[a-zA-Z0-9/%?&=._-]+
08:37:16 background.py:230 DEBUG    [reload] command cached: /Users/kai/Library/Caches/com.runningwithcrayons.Alfred/Workflow Data/net.deanishe.alfred.video-conferences/reload.argcache
08:37:16 background.py:234 DEBUG    [reload] passing job to background runner: [u'python', '/Users/kai/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.CEAADCE6-17EA-42AB-B49E-9895D8DE7564/workflow/background.py', 'reload']
08:37:16 workflow.py:2080 ERROR    [Errno 2] No such file or directory
Traceback (most recent call last):
  File "/Users/kai/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.CEAADCE6-17EA-42AB-B49E-9895D8DE7564/workflow/workflow.py", line 2073, in run
    func(self)
  File "./video-conferences.py", line 218, in main
    run_in_background('reload', [sys.argv[0], '--reload'])
  File "/Users/kai/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.CEAADCE6-17EA-42AB-B49E-9895D8DE7564/workflow/background.py", line 235, in run_in_background
    retcode = subprocess.call(cmd)
  File "/Users/kai/.pyenv/versions/2.7.18/lib/python2.7/subprocess.py", line 172, in call
    return Popen(*popenargs, **kwargs).wait()
  File "/Users/kai/.pyenv/versions/2.7.18/lib/python2.7/subprocess.py", line 394, in __init__
    errread, errwrite)
  File "/Users/kai/.pyenv/versions/2.7.18/lib/python2.7/subprocess.py", line 1047, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory
08:37:16 workflow.py:2103 DEBUG    ---------- finished in 0.052s ----------
[08:37:16.361] Video Conferences[Script Filter] {
  "items": [
    {
      "valid": false,
      "subtitle": "[Errno 2] No such file or directory",
      "icon": {
        "path": "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/AlertStopIcon.icns"
      },
      "title": "Error in workflow 'Video Conferences'"
    }
  ]

 

Edited by millionwatts
Link to comment

Welcome @millionwatts,

 

5 hours ago, millionwatts said:

the updated version from here that is supposed to be compatible with Python 3

 

It is not. Those updates fix the Python 2 locations, they don’t try to update it to Python 3 which is a bigger change. When a Workflow has listings in the Alternatives column, those may be Python 3 or another language but never Python 2.

 

Install Python 2 as per the instruction in that repo, then download and try the Workflow but do not modify it beforehand.

Link to comment
  • 1 year later...

One of my favorite work is this Video conference. This works good on macOS Ventura but running into calendar access issue on macOS Sonoma. @vitor @deanishe and others -- request for review and resolution of this. 

 

19:21:07 workflow.py:2080 ERROR    No Access to Calendars
Traceback (most recent call last):
  File "/Alfred.alfredpreferences/workflows/user.workflow.F2AE98BD-B8F2-45B9-AA0E-FFBC6BEBB921/workflow/workflow.py", line 2073, in run
    func(self)
  File "./video-conferences.py", line 240, in main
    raise RuntimeError(data['error'])
RuntimeError: No Access to Calendars
19:21:07 workflow.py:2103 DEBUG    ---------- finished in 0.014s ----------
[19:21:07.683] Video Conferences[Script Filter] {
  "items": [
    {
      "valid": false,
      "subtitle": "No Access to Calendars",
      "icon": {
        "path": "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/AlertStopIcon.icns"
      },
      "title": "Error in workflow 'Video Conferences'"
    }
  ]
}

Link to comment
  • 1 month later...

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...