Jump to content

[WIP, POC] Spotlight like rich preview pane for alfred workflows


Recommended Posts

2 hours ago, Florian said:

would you mind sharing this last google workflow?

@Florian

[pre-release] There you go: https://github.com/mr-pennyworth/alfred-google/releases

Note: The reason the workflow doesn't directly visit a google search url each time, but instead loads a google search page and fills input values and submits forms is because the former led to captchas pretty soon, I guess the latter is more "human like"...

 

The app in the workflow is basically the app in https://github.com/mr-pennyworth/alfred-gif with large chunks of code deleted.

 

2 hours ago, Florian said:

I'm mainly a web dev and having a web window responding to alfred is really tickling my fancy.

The Google workflow has a one-way flow, btw. That is, the webview responds to alfred.
For a back-and-forth interaction, you can take a look at the GIF workflow.
It has file drag and drop, keyboard and mouse navigation etc.
My apologies, the GIF workflow code is damn messy and convoluted though.

 

2 hours ago, Florian said:

do you have a way to know the full list of available results?

or is it just the current one through the new "press secretary"?

Just the current one through the new press secretary.
However, if the results are coming from a script filter, you could independently capture and process those.

That's what the extra pane did pre-press-secretary.

Take a look at the tech QA: https://github.com/mr-pennyworth/alfred-extra-pane#technical-qa

(I haven't pushed the press-secretary code to alfred-extra-pane yet.)

 

2 hours ago, Florian said:

in their display order

https://github.com/mr-pennyworth/alfred-extra-pane#-in-script-filters-alfred-doesnt-simply-show-the-results-in-the-orderthey-appear-in-the-json-but-reorders-them-according-to-its-logic-how-doesthe-extra-pane-account-for-that-

 

2 hours ago, Florian said:

I'd love to have a web preview that's not entirely refreshed on every selection change, and a local server behind it to speed up things.

Excited to see what you build!

Link to post
3 hours ago, Chris Messina said:

Have you taken a look at the just-updated Algolia Autocomplete experience. Go here and hit ⌘-K.

 

These docs might be relevant?

Cool stuff!!
But looks like unrelated to what I meant by "search google as you type"...
Unless of course, I'm missing something...

How do you envision algolia autocomplete to be used to search google for quick answers?

Link to post
3 minutes ago, Florian said:

Damn, google in France looks like this now... 

Damn!

 

@Florian See if you can figure out the css selector of that dialog?

Then you can add that selector to this list here: https://github.com/mr-pennyworth/alfred-google/blob/main/google-viewer/AlfredGoogleViewer/main.swift#L13

and then recompile the app with ./build-scripts/mkapp.sh

 

Link to post
On 12/14/2020 at 5:48 AM, Mr Pennyworth said:

Is there a way to access the URL the web-searches are building?

 

On 12/14/2020 at 5:48 AM, Mr Pennyworth said:

Also, is there a programmatic way of accessing the web-searches?

 

https://www.deanishe.net/post/2019/05/workflow-suffix-web-search/

 

On 12/14/2020 at 5:48 AM, Mr Pennyworth said:

Having said all this, I must agree I don't really foresee much value in doing this for all web-searches because with the exception of google and wolframalpha, I would assume most of the searches are such that they require further interactions with results (like clicking a link, copying some text etc).

 

Can't you make the links clickable? You can make them clickable in the Quick Look preview.

 

Link to post
34 minutes ago, deanishe said:

Can't you make the links clickable?

I would assume so! :)

Just haven't found the need for it yet, and hence haven't tried to figure it out.

 

49 minutes ago, deanishe said:

Ah I'm so sorry for my sloppy framing of the question! :(

 

Quote

Is there a way to access the URL the web-searches are building?

By that I meant, when I type "<keyword> <search phrase>", Alfred shows a result corresponding to it like this:

2113267024_ScreenShot2020-12-15at1_18_24PM.thumb.png.0efa028885ef8c1a9c0fa5dc6be95ff1.png

When I press enter, the url opens in the browser. So, I assume, Alfred has internally built that URL, ready to be opened in a browser. My question (I guess, that should've been more of a feature request) was "how about making that URL accessible through quicklookurl or something similar?" (That way, with zero additional efforts/programming, the extra pane could pick it up)

 

56 minutes ago, deanishe said:

Also, is there a programmatic way of accessing the web-searches?

Sorry for the poor phrasing... I meant including the ones that come pre-installed.

Alfred.alfredpreferences/preferences/features/websearch/prefs.plist, very understandably, has only user-defined ones.

Link to post

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