surrealroad Posted September 5, 2017 Posted September 5, 2017 (edited) Since beta 7 of macOS High Sierra, I've been having issues with Alfred (v3.4.1) not allowing items to be actioned. For example, given this JSON output from a osascript (JS): { "items": [{ "title": "Add Reminder", "arg": -1, "valid": true, "subtitle": "Create a new reminder to \"something\"", "icon": { "path": "" } }], "variables": { "reminders": "[{\"arg\":-1,\"text\":\"something\",\"body\":\"\",\"date\":\"\",\"list\":\"\",\"priority\":null,\"application\":\"\"}]", "quitAfter": "true" } } (expanded for readability) I get the action showing up in Alfred, but it behaves as if `valid` was set to `false`. In other words, pressing enter doesn't do anything. Prior to beta 7, this had been working fine. I can't find what I could change in my code to resolve this. Edited September 5, 2017 by surrealroad
Andrew Posted September 5, 2017 Posted September 5, 2017 @surrealroad My test workflows are working on 10.13 Beta 7. Are you seeing any errors in the Alfred debugger (set to All Info), or in Console.app? Are any of your Script Filter workflows working (especially non-JS script filter ones)?
deanishe Posted September 5, 2017 Posted September 5, 2017 How are you outputting the JSON? Are you returning it or writing it to STDOUT?
surrealroad Posted September 5, 2017 Author Posted September 5, 2017 (edited) 5 hours ago, Andrew said: @surrealroad My test workflows are working on 10.13 Beta 7. Are you seeing any errors in the Alfred debugger (set to All Info), or in Console.app? Are any of your Script Filter workflows working (especially non-JS script filter ones)? nothing in the debugger, and all other workflows are fine. but AFAIK none of the other workflows are using JXA. 30 minutes ago, deanishe said: How are you outputting the JSON? Are you returning it or writing it to STDOUT? returning it Edited September 5, 2017 by surrealroad
deanishe Posted September 5, 2017 Posted September 5, 2017 Did you set the debugger to All Information? You should then see the JSON, not nothing.
surrealroad Posted September 6, 2017 Author Posted September 6, 2017 Apologies, by "nothing" I meant "no errors or anything out of the ordinary" Here's the output when I try to run: Starting debug for 'Reminders for Alfred 3' [2017-09-06 15:26:44][input.scriptfilter] Queuing argument 's' [2017-09-06 15:26:44][input.scriptfilter] Queuing argument 'so' [2017-09-06 15:26:44][input.scriptfilter] Queuing argument 'som' [2017-09-06 15:26:45][input.scriptfilter] Queuing argument 'some' [2017-09-06 15:26:45][input.scriptfilter] Script with argument 'some' finished [2017-09-06 15:26:45][STDERR: input.scriptfilter] /Users/jack/Dropbox/Alfred/Alfred.alfredpreferences/workflows/user.workflow.CDB1A90A-8ABD-4114-9CBC-2E7B38B91258/chrono.min.js [2017-09-06 15:26:45][input.scriptfilter] {"items":[{"title":"Add Reminder","arg":-1,"valid":true,"subtitle":"Create a new reminder to \"some\"","icon":{"path":""}}],"variables":{"reminders":"[{\"arg\":-1,\"text\":\"some\",\"body\":\"\",\"date\":\"\",\"list\":\"\",\"priority\":null,\"application\":\"\"}]","quitAfter":"false"}} [2017-09-06 15:26:45][input.scriptfilter] Queuing argument 'somet' [2017-09-06 15:26:45][input.scriptfilter] Queuing argument 'someth' [2017-09-06 15:26:45][input.scriptfilter] Queuing argument 'somethi' [2017-09-06 15:26:45][input.scriptfilter] Queuing argument 'somethin' [2017-09-06 15:26:45][input.scriptfilter] Queuing argument 'something' [2017-09-06 15:26:45][input.scriptfilter] Script with argument 'something' finished [2017-09-06 15:26:45][STDERR: input.scriptfilter] /Users/jack/Dropbox/Alfred/Alfred.alfredpreferences/workflows/user.workflow.CDB1A90A-8ABD-4114-9CBC-2E7B38B91258/chrono.min.js [2017-09-06 15:26:45][input.scriptfilter] {"items":[{"title":"Add Reminder","arg":-1,"valid":true,"subtitle":"Create a new reminder to \"something\"","icon":{"path":""}}],"variables":{"reminders":"[{\"arg\":-1,\"text\":\"something\",\"body\":\"\",\"date\":\"\",\"list\":\"\",\"priority\":null,\"application\":\"\"}]","quitAfter":"false"}}
deanishe Posted September 7, 2017 Posted September 7, 2017 Where's the workflow that's having the issue? It's very difficult to diagnose an issue without being able to replicate it.
surrealroad Posted September 7, 2017 Author Posted September 7, 2017 8 hours ago, deanishe said: Where's the workflow that's having the issue? It's very difficult to diagnose an issue without being able to replicate it.
deanishe Posted September 7, 2017 Posted September 7, 2017 Thanks. I figured it's that workflow, but are we talking about the latest release or an unreleased dev version? To be clear, the workflow works perfectly for me, but I'm not running High Sierra because I don't run beta versions (or .0 versions) of OSes. I just want it to be clear which code you're talking about, in case somebody else can replicate the issue.
surrealroad Posted September 8, 2017 Author Posted September 8, 2017 It's the current release version. Works fine except on High Sierra.
Andrew Posted September 11, 2017 Posted September 11, 2017 @surrealroad sorry about the delay on this, I haven't had a dev setup on High Sierra so haven't been able to looking into this with more detail. It looks like Apple's framework or JSON parsing has changed a little, and where Alfred is expecting a string for the "arg" field, you are passing an integer. Before High Sierra, Alfred would happily take any object type and fall back onto the objects description, in terms of e.g number -1, that would be "-1" as a string. This no longer seems to happen. I'm going to look a little deeper into this and likely create a workaround or fix, but in the short term, you can fix this by returning "-1" instead of -1 for the arg. (For reference, the JSON format is here: https://www.alfredapp.com/help/workflows/inputs/script-filter/json/) surrealroad 1
Andrew Posted September 11, 2017 Posted September 11, 2017 Update: I'm currently working on a generic fix, as this turns out to be a more holistic issue than framework / JSON. Shouldn't manifest itself much, but better to be safe than sorry
Andrew Posted September 20, 2017 Posted September 20, 2017 @surrealroad I've now made this fix, could you please let me know how you get on? surrealroad 1
surrealroad Posted September 21, 2017 Author Posted September 21, 2017 20 hours ago, Andrew said: @surrealroad I've now made this fix, could you please let me know how you get on? Thanks Andrew, sorry for the delay, I was away on vacation. I've just tested on build 874 high sierra b9 and it's looking good! Andrew 1
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now