Kalaschnik Posted December 8, 2023 Share Posted December 8, 2023 (edited) Hey everyone, I am writing my first workflow. After doing everything in JXA, I discovered https://github.com/sindresorhus/alfy, which I enjoy. In my use case, I have a simple API endpoint returning JSON. In that endpoint, I can search/filter for a title, but I am interested in the key property. When pressing tab or enter I set autocomplete and the key to key. In other words, a video is more helpful than my description: (Screen capture is from this workflow) After pressing tab/enter on Breaking Bad, it takes the output key of it and launches like a new search instance. How do I achieve this in JavaScript land? Edited December 8, 2023 by Kalaschnik Link to comment
vitor Posted December 8, 2023 Share Posted December 8, 2023 2 hours ago, Kalaschnik said: After doing everything in JXA, I discovered https://github.com/sindresorhus/alfy, which I enjoy. If you’re using a library, then it becomes a question for its author or documentation. 2 hours ago, Kalaschnik said: When pressing tab or enter I set autocomplete and the key to key. That part is unclear. There is an autocomplete key in Alfred’s Script Filter JSON, but no key. What exactly are you doing? 3 hours ago, Kalaschnik said: After pressing tab/enter on Breaking Bad, it takes the output key of it and launches like a new search instance. The way to force the autocomplete to expand on ↩ is to set valid to false. The Script Filter then reruns because the input changed. Presumably (haven’t verified), that workflow is checking if the input starts with a known string (t: or m:) to react accordingly. 3 hours ago, Kalaschnik said: How do I achieve this in JavaScript land? The language is irrelevant. All that matters is that you output the correct JSON. Kalaschnik 1 Link to comment
Kalaschnik Posted December 8, 2023 Author Share Posted December 8, 2023 (edited) 28 minutes ago, vitor said: That part is unclear. There is an autocomplete key in Alfred’s Script Filter JSON, but no key. What exactly are you doing? Sorry my bad, I meant arg! Edited December 8, 2023 by Kalaschnik Link to comment
Kalaschnik Posted December 8, 2023 Author Share Posted December 8, 2023 30 minutes ago, vitor said: The way to force the autocomplete to expand on ↩ is to set valid to false. The Script Filter then reruns because the input changed. Presumably (haven’t verified), that workflow is checking if the input starts with a known string (t: or m:) to react accordingly. That part is really helpful! Thank you vitor! Link to comment
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