Jump to content

Workflow to get next meeting location/url and open it


Recommended Posts

😰🥳🥳nope

 

[17:09:10.138] Logging Started...

[17:09:16.099] Video Conferences[Script Filter] Queuing argument '(null)'

[17:09:16.332] Video Conferences[Script Filter] Script with argv '(null)' finished

[17:09:16.337] STDERR: Video Conferences[Script Filter] .

17:09:16 workflow.py:2061 DEBUG    ---------- Video Conferences (0.0.3) ----------

17:09:16 video-conferences.py:195 DEBUG    args={'--calendar': None,

'--event': None,

'--force-reload': False,

'--help': False,

'--notify': False,

'--reload': False,

'<query>': None}

17:09:16 video-conferences.py:64 DEBUG    max_cache_age=1200

17:09:16 video-conferences.py:66 DEBUG    lookahead_days=3

17:09:16 video-conferences.py:81 DEBUG    regex=https://([a-z0-9]+\.)?zoom\.us/j/\d+\?pwd=[a-z0-9]+

17:09:16 video-conferences.py:81 DEBUG    regex=https://meet\.google\.com/[a-z-]+

17:09:16 video-conferences.py:81 DEBUG    regex=https://[a-z0-9]+\.zoom\.us/[a-z0-9_.-]+/\d+\?pwd=[a-z0-9]+

17:09:16 video-conferences.py:81 DEBUG    regex=https://meet\.lync\.com/[a-z0-9_.-]+/[a-z0-9_.-]+/[a-z0-9]+

17:09:16 workflow.py:1695 DEBUG    loading cached data: /Users/macpro/Library/Caches/com.runningwithcrayons.Alfred/Workflow Data/net.deanishe.alfred.video-conferences/events.cpickle

17:09:16 video-conferences.py:244 DEBUG    0/7 event(s) in specified accounts & calendars are video conferences

17:09:16 workflow.py:1468 DEBUG    reading settings from /Users/macpro/Library/Application Support/Alfred/Workflow Data/net.deanishe.alfred.video-conferences/settings.json

17:09:16 workflow.py:2254 DEBUG    set last run version: 0.0.3

17:09:16 workflow.py:2103 DEBUG    ---------- finished in 0.040s ----------

[17:09:16.341] Video Conferences[Script Filter] {"items": [{"valid": false, "subtitle": "", "icon": {"path": "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/AlertCautionIcon.icns"}, "title": "No Video Conferences"}]}

Bildschirmfoto 2020-05-16 um 17.09.58.jpg

Link to comment
3 hours ago, tosbsas said:

😰🥳🥳nope

 

[17:09:10.138] Logging Started...

[17:09:16.099] Video Conferences[Script Filter] Queuing argument '(null)'

[17:09:16.332] Video Conferences[Script Filter] Script with argv '(null)' finished

[17:09:16.337] STDERR: Video Conferences[Script Filter] .

17:09:16 workflow.py:2061 DEBUG    ---------- Video Conferences (0.0.3) ----------

17:09:16 video-conferences.py:195 DEBUG    args={'--calendar': None,

'--event': None,

'--force-reload': False,

'--help': False,

'--notify': False,

'--reload': False,

'<query>': None}

17:09:16 video-conferences.py:64 DEBUG    max_cache_age=1200

17:09:16 video-conferences.py:66 DEBUG    lookahead_days=3

17:09:16 video-conferences.py:81 DEBUG    regex=https://([a-z0-9]+\.)?zoom\.us/j/\d+\?pwd=[a-z0-9]+

17:09:16 video-conferences.py:81 DEBUG    regex=https://meet\.google\.com/[a-z-]+

17:09:16 video-conferences.py:81 DEBUG    regex=https://[a-z0-9]+\.zoom\.us/[a-z0-9_.-]+/\d+\?pwd=[a-z0-9]+

17:09:16 video-conferences.py:81 DEBUG    regex=https://meet\.lync\.com/[a-z0-9_.-]+/[a-z0-9_.-]+/[a-z0-9]+

17:09:16 workflow.py:1695 DEBUG    loading cached data: /Users/macpro/Library/Caches/com.runningwithcrayons.Alfred/Workflow Data/net.deanishe.alfred.video-conferences/events.cpickle

17:09:16 video-conferences.py:244 DEBUG    0/7 event(s) in specified accounts & calendars are video conferences

17:09:16 workflow.py:1468 DEBUG    reading settings from /Users/macpro/Library/Application Support/Alfred/Workflow Data/net.deanishe.alfred.video-conferences/settings.json

17:09:16 workflow.py:2254 DEBUG    set last run version: 0.0.3

17:09:16 workflow.py:2103 DEBUG    ---------- finished in 0.040s ----------

[17:09:16.341] Video Conferences[Script Filter] {"items": [{"valid": false, "subtitle": "", "icon": {"path": "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/AlertCautionIcon.icns"}, "title": "No Video Conferences"}]}

Bildschirmfoto 2020-05-16 um 17.09.58.jpg

 

Could you message me the format of the URL to test with?

Link to comment
2 hours ago, Terminal said:

Awesome! Checking out the regex now

 

 

@deanishe just appears your aren't capturing url's that don't require or don't embed the pwd component. I would update this regex to be

 


r"https://[a-z0-9]+\.zoom\.us/[a-z0-9_.-]+/\d+(?:\?pwd=[a-z0-9]+)?"

 

 

No, I'm not capturing URLs without the password. I figured since all the fun people had gatecrashing Zoom meetings thanks to the easily-guessable numbers, everyone would be using passwords now.

 

Apparently not… I guess I'll have update the workflow again.

Link to comment
6 hours ago, Terminal said:

@tosbsas since you can update the regex yourself,

 

1. Open Alfred Preferences

2. Click Workflows

3. Click Video Conferences

4. Click the [X] Icon

5. Edit the zoom_regex_2 and put https://[a-z0-9]+\.zoom\.us/[a-z0-9_.-]+/\d+(?:\?pwd=[a-z0-9]+)?

6. Alfred -> .vc reload

works now perfect

Link to comment
  • 1 month later...
  • 4 weeks later...

@deanishe Thank  you for this, it's great !

 

I tweaked it a little bit, in order to just join the ZOOM meeting without having to open a browser tab. I'm new to Alfred and Python so it's only a humble hack, with hardcoded regex. 

 

I used Zoom url-scheme, as per https://marketplace.zoom.us/docs/guides/guides/client-url-schemes

 

In video-conferences.py: 

(Around line 261....)
it.setvar('event_id', d['uid'])

# PDAZERO: Set url to zoom scheme (in case it's zoom)
zoom_url_match = re.search('https://[a-z0-9]+\.zoom\.us/[a-z0-9_.-]+/(\d+.*)',d['url'])
if zoom_url_match:
  it.setvar('zoom_url','zoommtg://zoom.us/join?confno=' + zoom_url_match.group(1))

And then open url with the "zoom_url" variable. If you are interested maybe you could do this a lot cleaner but my coding skills are not at their best today. Thanks again for this workflow.

Link to comment
  • 4 weeks later...
3 hours ago, pdazero said:

I don't find a way to access  that list in your script.

 

You need to edit the CalendarEvents.scpt script. Something like this:

let arr = getEvents(days),
  ekEvents = arr[0],
  colours = arr[1],
  attendees = []

ekEvents.forEach(event => {
  if (event.status === $.EKEventStatusCanceled) return
  if (event.allDay) return

  let title = ObjC.unwrap(event.title),
    url = ObjC.unwrap(event.URL.absoluteString),
    notes = ObjC.unwrap(event.notes),
    location = ObjC.unwrap(event.location)

  if (event.hasAttendees) {
    ObjC.unwrap(event.attendees).forEach(a => {
      attendees.push(ObjC.unwrap(a.name))
    })
  }

  // ensure these have values otherwise they'll be omitted from
  // JSON output because they're undefined
  title = title ? title : ''
  url = url ? url : ''
  notes = notes ? notes : ''
  location = location ? location : ''

  events.push({
    uid: ObjC.unwrap(event.eventIdentifier),
    title: title,
    url: url,
    notes: notes,
    location: location,
    attendees: attendees,
    account: ObjC.unwrap(event.calendar.source.title),
    calendar: ObjC.unwrap(event.calendar.title),
    calendar_id: ObjC.unwrap(event.calendar.calendarIdentifier),
    start_date: ObjC.unwrap(formatter.stringFromDate(event.startDate)),
    end_date: ObjC.unwrap(formatter.stringFromDate(event.endDate)),
    colour: colours[ObjC.unwrap(event.calendar.calendarIdentifier)],
  })
})

 

Link to comment
  • 2 weeks later...

@deanisheThank you. I have to say this was a huge feat for me, but finally managed to do it. I first had to learn javascript arrow functions, what the hell is objc.unwrap() and other spices lol.

 

Here is the final run function from CalendarEvents.scpt:

function run(argv) {
	if (!haveAccess()) {
		return JSON.stringify({error: 'No Access to Calendars', events: []})
	}

	let days = 7,
		events = [],
		formatter = $.NSISO8601DateFormatter.alloc.init
		
	// convert all times to local time because Python sucks at timezones
	formatter.timeZone = $.NSTimeZone.localTimeZone

	if (argv.length > 0) days = parseInt(argv[0], 10)
	
	let arr = getEvents(days),
		ekEvents = arr[0],
		colours = arr[1],
		attendees = [],
		strAttendees = ''

	ekEvents.forEach(event => {
			
		if (event.status === $.EKEventStatusCanceled) return
		if (event.allDay) return
				
		let title = ObjC.unwrap(event.title),
			url = ObjC.unwrap(event.URL.absoluteString),
			notes = ObjC.unwrap(event.notes),
			location = ObjC.unwrap(event.location)

		// Clean attendees
		while (attendees.length > 0) {
		 	attendees.pop();
		}
					
		if (event.hasAttendees) {
			ObjC.unwrap(event.attendees).forEach(a => {
				attendees.push(ObjC.unwrap(a.name))
				}
			)
			strAttendees = attendees.join();
		}
		
		// ensure these have values otherwise they'll be omitted from
		// JSON output because they're undefined
		title = title ? title : ''
		url = url ? url : ''
		notes = notes ? notes : ''
		location = location ? location : ''

		events.push({
			uid: ObjC.unwrap(event.eventIdentifier),
			title: title,
			url: url,
			notes: notes,
			location: location,
			attendees: strAttendees,
			account: ObjC.unwrap(event.calendar.source.title),
			calendar: ObjC.unwrap(event.calendar.title),
			calendar_id: ObjC.unwrap(event.calendar.calendarIdentifier),
			start_date: ObjC.unwrap(formatter.stringFromDate(event.startDate)),
			end_date: ObjC.unwrap(formatter.stringFromDate(event.endDate)),
			colour: colours[ObjC.unwrap(event.calendar.calendarIdentifier)],
		})
	})
	
	events.sort((a, b) => {
		if (a.start_date < b.start_date) return -1
		if (a.start_date > b.start_date) return 1
		if (a.title < b.title) return -1
		if (a.title > b.title) return 1
		return 0
	})
	
	console.log(`${events.length} event(s)`)

	return JSON.stringify({error: null, events: events})
}

So, I modified a bit your suggestion in order to pass a comma-separated list of the attendees. I had to did this because it looks I had troubles with passing an array.

 

Then, edited main function on video-conferences.py (just an excerpt):

 

    icons = Icons(wf.cachefile('icons'))
    for d in events:
        subtitle = u'{}–{} on {} // {} ({})'.format(
            d['start_date'].strftime('%H:%M'),
            d['end_date'].strftime('%H:%M'),
            d['start_date'].strftime('%Y-%m-%d'),
            d['calendar'], d['account'])

        it = wf.add_item(d['title'], subtitle, arg=d['url'], valid=True,
                         icon=icons.get_icon(d['colour']))
        it.setvar('calendar_name', d['calendar'])
        it.setvar('event_id', d['uid'])
    
        # PDAZERO: Set url to zoom scheme (in case it's zoom)
        zoom_url_match = re.search('https://[a-z0-9]+\.zoom\.us/[a-z0-9_.-]+/(\d+.*)',d['url'])
        if zoom_url_match:
            it.setvar('zoom_url','zoommtg://zoom.us/join?confno=' + zoom_url_match.group(1))

        if d['attendees'] is not None:
            strAttendees = ''
            attendees = d['attendees'].split(',')
            for attendee in attendees:
                strAttendees = strAttendees + "\n- " + attendee

            it.setvar('attendees', strAttendees)
            del strAttendees
        else:
            it.setvar('attendees', '')

Later on, I just pass the attendees var to the clipboard and paste it on my markdown minute. I'll work now in building the minute from scratch because I still have friction in that part of my everyday routine.

 

BTW I'm also using https://www.aaronsaray.com/2020/leave-zoom-with-alfred "lz" alfred command to just leave the meeting right now without fiddling with the exit buttons.

 

Thanks again !

Link to comment
2 hours ago, pdazero said:

what the hell is objc.unwrap()

 

Objective-C APIs (i.e. macOS APIs) don’t return JavaScript objects. ObjC.unwrap() converts Objective-C strings/arrays/etc. to JavaScript ones.

 

I don't understand why you're converting the array of attendees into a string only to convert it back to an array in Python.

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

Hi all, started using this workflow (version 0.1.1) however I can't get it to work out of the box. 

  • After installing tried to restart MacOS (Catalina 10.15.7), using Alfred 4 + powerpack - .vc reload didn't help
  • It's stuck on "Loading events..results should appear momentarily"
  • Didn't change any of the config vars
  • Using Google Meet + Calendar.app - meetings are visible in Calendar.app and contain meet.google.com links
  • Alfred has access/permission to Calendar app

Any thoughts?

Fullscreen_18_11_2020__14_53.png

Link to comment
[16:28:02.647] Logging Started...
[16:28:17.654] Video Conferences[Script Filter] Queuing argument '(null)'
[16:28:17.991] Video Conferences[Script Filter] Script with argv '(null)' finished
[16:28:17.995] STDERR: Video Conferences[Script Filter] .
16:28:17 workflow.py:2061 DEBUG    ---------- Video Conferences (0.1.1) ----------
16:28:17 video-conferences.py:196 DEBUG    args={'--calendar': None,
 '--event': None,
 '--force-reload': False,
 '--help': False,
 '--notify': False,
 '--reload': False,
 '<query>': None}
16:28:17 video-conferences.py:65 DEBUG    max_cache_age=300
16:28:17 video-conferences.py:67 DEBUG    lookahead_days=3
16:28:17 video-conferences.py:82 DEBUG    regex=https://([a-z0-9]+\.)?zoom\.us/j/\d+(\?pwd=[a-z0-9]+)?
16:28:17 video-conferences.py:82 DEBUG    regex=https://meet\.google\.com/[a-z-]+
16:28:17 video-conferences.py:82 DEBUG    regex=https://[a-z0-9]+\.zoom\.us/[a-z0-9_.-]+/\d+\?pwd=[a-z0-9]+
16:28:17 video-conferences.py:76 DEBUG    calendar='Default'
16:28:17 video-conferences.py:82 DEBUG    regex=https://meet\.lync\.com/[a-z0-9_.-]+/[a-z0-9_.-]+/[a-z0-9]+
16:28:17 background.py:233 DEBUG    [reload] command cached: /Users/[MY_USER_FOLDER]/Library/Caches/com.runningwithcrayons.Alfred/Workflow Data/net.deanishe.alfred.video-conferences/reload.argcache
16:28:17 background.py:237 DEBUG    [reload] passing job to background runner: [u'/usr/bin/python', '/Users/[MY_USER_FOLDER]/Dropbox/Alfred/Alfred.alfredpreferences/workflows/user.workflow.DAF8E937-5E2D-41A2-B19C-74C900DB585F/workflow/background.pyc', 'reload']
.
16:28:17 workflow.py:2061 DEBUG    ---------- Video Conferences (0.1.1) ----------
16:28:17 background.py:243 DEBUG    [reload] background job started
16:28:17 workflow.py:1468 DEBUG    reading settings from /Users/[MY_USER_FOLDER]/Library/Application Support/Alfred/Workflow Data/net.deanishe.alfred.video-conferences/settings.json
16:28:17 workflow.py:2254 DEBUG    set last run version: 0.1.1
16:28:17 workflow.py:2103 DEBUG    ---------- finished in 0.150s ----------
[16:28:17.998] Video Conferences[Script Filter] {"items": [{"valid": false, "subtitle": "Results should appear momentarily", "icon": {"path": "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/ToolbarInfo.icns"}, "title": "Loading Events\u2026"}], "rerun": 0.2}
[16:28:18.195] Video Conferences[Script Filter] Queuing argument '(null)'
[16:28:18.337] Video Conferences[Script Filter] Script with argv '(null)' finished
[16:28:18.347] STDERR: Video Conferences[Script Filter] .
16:28:18 workflow.py:2061 DEBUG    ---------- Video Conferences (0.1.1) ----------
16:28:18 video-conferences.py:196 DEBUG    args={'--calendar': None,
 '--event': None,
 '--force-reload': False,
 '--help': False,
 '--notify': False,
 '--reload': False,
 '<query>': None}
16:28:18 video-conferences.py:65 DEBUG    max_cache_age=300
16:28:18 video-conferences.py:67 DEBUG    lookahead_days=3
16:28:18 video-conferences.py:82 DEBUG    regex=https://([a-z0-9]+\.)?zoom\.us/j/\d+(\?pwd=[a-z0-9]+)?
16:28:18 video-conferences.py:82 DEBUG    regex=https://meet\.google\.com/[a-z-]+
16:28:18 video-conferences.py:82 DEBUG    regex=https://[a-z0-9]+\.zoom\.us/[a-z0-9_.-]+/\d+\?pwd=[a-z0-9]+
16:28:18 video-conferences.py:76 DEBUG    calendar='Default'
16:28:18 video-conferences.py:82 DEBUG    regex=https://meet\.lync\.com/[a-z0-9_.-]+/[a-z0-9_.-]+/[a-z0-9]+
16:28:18 workflow.py:1468 DEBUG    reading settings from /Users/[MY_USER_FOLDER]/Library/Application Support/Alfred/Workflow Data/net.deanishe.alfred.video-conferences/settings.json
16:28:18 workflow.py:2254 DEBUG    set last run version: 0.1.1
16:28:18 workflow.py:2103 DEBUG    ---------- finished in 0.032s ----------
[16:28:18.349] Video Conferences[Script Filter] {"items": [{"valid": false, "subtitle": "Results should appear momentarily", "icon": {"path": "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/ToolbarInfo.icns"}, "title": "Loading Events\u2026"}], "rerun": 0.2}
[16:28:18.541] Video Conferences[Script Filter] Queuing argument '(null)'
[16:28:18.732] Video Conferences[Script Filter] Script with argv '(null)' finished
[16:28:18.747] STDERR: Video Conferences[Script Filter] .
16:28:18 workflow.py:2061 DEBUG    ---------- Video Conferences (0.1.1) ----------
16:28:18 video-conferences.py:196 DEBUG    args={'--calendar': None,
 '--event': None,
 '--force-reload': False,
 '--help': False,
 '--notify': False,
 '--reload': False,
 '<query>': None}
16:28:18 video-conferences.py:65 DEBUG    max_cache_age=300
16:28:18 video-conferences.py:67 DEBUG    lookahead_days=3
16:28:18 video-conferences.py:82 DEBUG    regex=https://([a-z0-9]+\.)?zoom\.us/j/\d+(\?pwd=[a-z0-9]+)?
16:28:18 video-conferences.py:82 DEBUG    regex=https://meet\.google\.com/[a-z-]+
16:28:18 video-conferences.py:82 DEBUG    regex=https://[a-z0-9]+\.zoom\.us/[a-z0-9_.-]+/\d+\?pwd=[a-z0-9]+
16:28:18 video-conferences.py:76 DEBUG    calendar='Default'
16:28:18 video-conferences.py:82 DEBUG    regex=https://meet\.lync\.com/[a-z0-9_.-]+/[a-z0-9_.-]+/[a-z0-9]+
16:28:18 workflow.py:1468 DEBUG    reading settings from /Users/[MY_USER_FOLDER]/Library/Application Support/Alfred/Workflow Data/net.deanishe.alfred.video-conferences/settings.json
16:28:18 workflow.py:2254 DEBUG    set last run version: 0.1.1
16:28:18 workflow.py:2103 DEBUG    ---------- finished in 0.032s ----------
[16:28:18.749] Video Conferences[Script Filter] {"items": [{"valid": false, "subtitle": "Results should appear momentarily", "icon": {"path": "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/ToolbarInfo.icns"}, "title": "Loading Events\u2026"}], "rerun": 0.2}
[16:28:18.934] Video Conferences[Script Filter] Queuing argument '(null)'
[16:28:19.092] Video Conferences[Script Filter] Script with argv '(null)' finished
[16:28:19.103] STDERR: Video Conferences[Script Filter] .
16:28:19 workflow.py:2061 DEBUG    ---------- Video Conferences (0.1.1) ----------
16:28:19 video-conferences.py:196 DEBUG    args={'--calendar': None,
 '--event': None,
 '--force-reload': False,
 '--help': False,
 '--notify': False,
 '--reload': False,
 '<query>': None}
16:28:19 video-conferences.py:65 DEBUG    max_cache_age=300
16:28:19 video-conferences.py:67 DEBUG    lookahead_days=3
16:28:19 video-conferences.py:82 DEBUG    regex=https://([a-z0-9]+\.)?zoom\.us/j/\d+(\?pwd=[a-z0-9]+)?
16:28:19 video-conferences.py:82 DEBUG    regex=https://meet\.google\.com/[a-z-]+
16:28:19 video-conferences.py:82 DEBUG    regex=https://[a-z0-9]+\.zoom\.us/[a-z0-9_.-]+/\d+\?pwd=[a-z0-9]+
16:28:19 video-conferences.py:76 DEBUG    calendar='Default'
16:28:19 video-conferences.py:82 DEBUG    regex=https://meet\.lync\.com/[a-z0-9_.-]+/[a-z0-9_.-]+/[a-z0-9]+
16:28:19 workflow.py:1468 DEBUG    reading settings from /Users/[MY_USER_FOLDER]/Library/Application Support/Alfred/Workflow Data/net.deanishe.alfred.video-conferences/settings.json
16:28:19 workflow.py:2254 DEBUG    set last run version: 0.1.1
16:28:19 workflow.py:2103 DEBUG    ---------- finished in 0.037s ----------
[16:28:19.105] Video Conferences[Script Filter] {"items": [{"valid": false, "subtitle": "Results should appear momentarily", "icon": {"path": "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/ToolbarInfo.icns"}, "title": "Loading Events\u2026"}], "rerun": 0.2}
[16:28:19.294] Video Conferences[Script Filter] Queuing argument '(null)'
[16:28:19.489] Video Conferences[Script Filter] Script with argv '(null)' finished
[16:28:19.499] STDERR: Video Conferences[Script Filter] .
16:28:19 workflow.py:2061 DEBUG    ---------- Video Conferences (0.1.1) ----------
16:28:19 video-conferences.py:196 DEBUG    args={'--calendar': None,
 '--event': None,
 '--force-reload': False,
 '--help': False,
 '--notify': False,
 '--reload': False,
 '<query>': None}
16:28:19 video-conferences.py:65 DEBUG    max_cache_age=300
16:28:19 video-conferences.py:67 DEBUG    lookahead_days=3
16:28:19 video-conferences.py:82 DEBUG    regex=https://([a-z0-9]+\.)?zoom\.us/j/\d+(\?pwd=[a-z0-9]+)?
16:28:19 video-conferences.py:82 DEBUG    regex=https://meet\.google\.com/[a-z-]+
16:28:19 video-conferences.py:82 DEBUG    regex=https://[a-z0-9]+\.zoom\.us/[a-z0-9_.-]+/\d+\?pwd=[a-z0-9]+
16:28:19 video-conferences.py:76 DEBUG    calendar='Default'
16:28:19 video-conferences.py:82 DEBUG    regex=https://meet\.lync\.com/[a-z0-9_.-]+/[a-z0-9_.-]+/[a-z0-9]+
16:28:19 workflow.py:1468 DEBUG    reading settings from /Users/[MY_USER_FOLDER]/Library/Application Support/Alfred/Workflow Data/net.deanishe.alfred.video-conferences/settings.json
16:28:19 workflow.py:2254 DEBUG    set last run version: 0.1.1
16:28:19 workflow.py:2103 DEBUG    ---------- finished in 0.035s ----------
[16:28:19.502] Video Conferences[Script Filter] {"items": [{"valid": false, "subtitle": "Results should appear momentarily", "icon": {"path": "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/ToolbarInfo.icns"}, "title": "Loading Events\u2026"}], "rerun": 0.2}
[16:28:19.692] Video Conferences[Script Filter] Queuing argument '(null)'
[16:28:19.824] Video Conferences[Script Filter] Script with argv '(null)' finished
[16:28:19.839] STDERR: Video Conferences[Script Filter] .
16:28:19 workflow.py:2061 DEBUG    ---------- Video Conferences (0.1.1) ----------
....
....
....

 

Sorry, wasn't aware of the debugger. See log above.

Link to comment
5 minutes ago, deanishe said:

Thanks. I'm afraid that's also no help: the problem is with fetching events from Calendar.app, which happens in the background.

 

Please check the log file instead (enter .vc workflow:openlog into Alfred).

 


17:19:39 workflow.py:2080 ERROR    time data '2020-11-18T08:' does not match format '%Y-%m-%dT%H:%M:%S'
Traceback (most recent call last):
  File "/Users/[MY_USER_FOLDER]/Dropbox/Alfred/Alfred.alfredpreferences/workflows/user.workflow.DAF8E937-5E2D-41A2-B19C-74C900DB585F/workflow/workflow.py", line 2073, in run
    func(self)
  File "/Users/[MY_USER_FOLDER]/Dropbox/Alfred/Alfred.alfredpreferences/workflows/user.workflow.DAF8E937-5E2D-41A2-B19C-74C900DB585F/video-conferences.py", line 205, in main
    return do_reload(args['--notify'])
  File "/Users/[MY_USER_FOLDER]/Dropbox/Alfred/Alfred.alfredpreferences/workflows/user.workflow.DAF8E937-5E2D-41A2-B19C-74C900DB585F/video-conferences.py", line 162, in do_reload
    data = load_events()
  File "/Users/[MY_USER_FOLDER]/Dropbox/Alfred/Alfred.alfredpreferences/workflows/user.workflow.DAF8E937-5E2D-41A2-B19C-74C900DB585F/video-conferences.py", line 112, in load_events
    event['start_date'] = parse_date(event['start_date'])
  File "/Users/[MY_USER_FOLDER]/Dropbox/Alfred/Alfred.alfredpreferences/workflows/user.workflow.DAF8E937-5E2D-41A2-B19C-74C900DB585F/video-conferences.py", line 98, in parse_date
    return datetime.strptime(s[:-6], '%Y-%m-%dT%H:%M:%S')
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/_strptime.py", line 332, in _strptime
    (data_string, format))
ValueError: time data '2020-11-18T08:' does not match format '%Y-%m-%dT%H:%M:%S'
17:19:42 workflow.py:2080 ERROR    time data '2020-11-18T08:' does not match format '%Y-%m-%dT%H:%M:%S'
Traceback (most recent call last):
  File "/Users/[MY_USER_FOLDER]/Dropbox/Alfred/Alfred.alfredpreferences/workflows/user.workflow.DAF8E937-5E2D-41A2-B19C-74C900DB585F/workflow/workflow.py", line 2073, in run
    func(self)
  File "/Users/[MY_USER_FOLDER]/Dropbox/Alfred/Alfred.alfredpreferences/workflows/user.workflow.DAF8E937-5E2D-41A2-B19C-74C900DB585F/video-conferences.py", line 205, in main
    return do_reload(args['--notify'])
  File "/Users/[MY_USER_FOLDER]/Dropbox/Alfred/Alfred.alfredpreferences/workflows/user.workflow.DAF8E937-5E2D-41A2-B19C-74C900DB585F/video-conferences.py", line 162, in do_reload
    data = load_events()
  File "/Users/[MY_USER_FOLDER]/Dropbox/Alfred/Alfred.alfredpreferences/workflows/user.workflow.DAF8E937-5E2D-41A2-B19C-74C900DB585F/video-conferences.py", line 112, in load_events
    event['start_date'] = parse_date(event['start_date'])
  File "/Users/[MY_USER_FOLDER]/Dropbox/Alfred/Alfred.alfredpreferences/workflows/user.workflow.DAF8E937-5E2D-41A2-B19C-74C900DB585F/video-conferences.py", line 98, in parse_date
    return datetime.strptime(s[:-6], '%Y-%m-%dT%H:%M:%S')
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/_strptime.py", line 332, in _strptime
    (data_string, format))
ValueError: time data '2020-11-18T08:' does not match format '%Y-%m-%dT%H:%M:%S'
17:19:46 workflow.py:2080 ERROR    time data '2020-11-18T08:' does not match format '%Y-%m-%dT%H:%M:%S'
Traceback (most recent call last):
  File "/Users/[MY_USER_FOLDER]/Dropbox/Alfred/Alfred.alfredpreferences/workflows/user.workflow.DAF8E937-5E2D-41A2-B19C-74C900DB585F/workflow/workflow.py", line 2073, in run
    func(self)
  File "/Users/[MY_USER_FOLDER]/Dropbox/Alfred/Alfred.alfredpreferences/workflows/user.workflow.DAF8E937-5E2D-41A2-B19C-74C900DB585F/video-conferences.py", line 205, in main
    return do_reload(args['--notify'])
  File "/Users/[MY_USER_FOLDER]/Dropbox/Alfred/Alfred.alfredpreferences/workflows/user.workflow.DAF8E937-5E2D-41A2-B19C-74C900DB585F/video-conferences.py", line 162, in do_reload
    data = load_events()
  File "/Users/[MY_USER_FOLDER]/Dropbox/Alfred/Alfred.alfredpreferences/workflows/user.workflow.DAF8E937-5E2D-41A2-B19C-74C900DB585F/video-conferences.py", line 112, in load_events
    event['start_date'] = parse_date(event['start_date'])
  File "/Users/[MY_USER_FOLDER]/Dropbox/Alfred/Alfred.alfredpreferences/workflows/user.workflow.DAF8E937-5E2D-41A2-B19C-74C900DB585F/video-conferences.py", line 98, in parse_date
    return datetime.strptime(s[:-6], '%Y-%m-%dT%H:%M:%S')
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/_strptime.py", line 332, in _strptime
    (data_string, format))
ValueError: time data '2020-11-18T08:' does not match format '%Y-%m-%dT%H:%M:%S'
17:19:49 workflow.py:2080 ERROR    time data '2020-11-18T08:' does not match format '%Y-%m-%dT%H:%M:%S'
Traceback (most recent call last):
  File "/Users/[MY_USER_FOLDER]/Dropbox/Alfred/Alfred.alfredpreferences/workflows/user.workflow.DAF8E937-5E2D-41A2-B19C-74C900DB585F/workflow/workflow.py", line 2073, in run
    func(self)
  File "/Users/[MY_USER_FOLDER]/Dropbox/Alfred/Alfred.alfredpreferences/workflows/user.workflow.DAF8E937-5E2D-41A2-B19C-74C900DB585F/video-conferences.py", line 205, in main
    return do_reload(args['--notify'])
  File "/Users/[MY_USER_FOLDER]/Dropbox/Alfred/Alfred.alfredpreferences/workflows/user.workflow.DAF8E937-5E2D-41A2-B19C-74C900DB585F/video-conferences.py", line 162, in do_reload
    data = load_events()
  File "/Users/[MY_USER_FOLDER]/Dropbox/Alfred/Alfred.alfredpreferences/workflows/user.workflow.DAF8E937-5E2D-41A2-B19C-74C900DB585F/video-conferences.py", line 112, in load_events
    event['start_date'] = parse_date(event['start_date'])
  File "/Users/[MY_USER_FOLDER]/Dropbox/Alfred/Alfred.alfredpreferences/workflows/user.workflow.DAF8E937-5E2D-41A2-B19C-74C900DB585F/video-conferences.py", line 98, in parse_date
    return datetime.strptime(s[:-6], '%Y-%m-%dT%H:%M:%S')
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/_strptime.py", line 332, in _strptime
    (data_string, format))
ValueError: time data '2020-11-18T08:' does not match format '%Y-%m-%dT%H:%M:%S'


Here is it. This seems more useful! Also reinstalled (without migrating setting) the Workflow. I've notices I don't have a calendar named "Default" - not sure if that gives a clue. Adding the variables for my existing calendar didn't change anything (after `reload`).

Thanks a lot!

Link to comment

Thanks. Okay, it's pretty clear what the problem is (the script doesn't like the dates it's getting from Calendar.app), but I'm not sure how to fix that.

 

Could you open the workflow in Finder (right-click on the workflow in Alfred Preferences), open the CalendarEvents.scpt script in Script Editor, choose “View > Show Result” (⌘2), run the script and check the values for start_date and end_date in the output.

 

The workflow is expecting YYYY-MM-DDTHH:MM:SS, but appears to be getting YYYY-MM-DDTHH:, which is basically nonsense. So let's see what the script is actually getting from Calendar.app.

 

If you know a specific event that's causing the issue, you could perhaps export the event as an ICS file and post its contents here (it's just a text file). If you do that, be sure to remove any sensitive data first: we're only interested in the dates & times.

Link to comment

Hi, here are some snippets from the results that contain the start/end_date keys:

-47D1-A1A4-622CA02AFBAD\",\"start_date\":\"2020-11-24T12:00:00Z\",\"end_date\":\"2020-11-24T13:00:00Z\",\"colour\":

 

-A1A4-622CA02AFBAD\",\"start_date\":\"2020-11-25T08:30:00Z\",\"end_date\":\"2020-11-25T09:30:00Z\",\"colour\":

 

-47D1-A1A4-622CA02AFBAD\",\"start_date\":\"2020-11-25T09:30:00Z\",\"end_date\":\"2020-11-25T10:00:00Z\",\"colour\":[0.9959999918937683,0.7649999856948853,0.03500000014901161,1]},{\"uid\":\"387C19A

 

Thanks for helping investigate!

Edited by jxxst
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...