Jump to content

2 questions about alfred web searches


Recommended Posts

Hello,

I have 2 questions about pref→ features→ web search

1- I am often in a web site in Chrome and want to add it to my alfred web searches. My current procedure is to go to the URL bar → copy URL → open alfred pref → features → web search → new custom search → fill in the form. Is there a quicker way ?

2- in keyboard maestro I am used to simulteneously opening a web site and displaying a notification banner which gives me a hint as to the login and password. I have found this to be very useful. Is there any equivalent in alfred ?

thanks in advance for your time and help

Link to comment
2 hours ago, rob213 said:

Is there a quicker way ?

 

Sure. You could write a script that generates an alfred://customsearch/ URL based on the active tab and then opens it in Alfred. Good luck figuring out how to insert {query} in the right place.

 

2 hours ago, rob213 said:

Is there any equivalent in alfred ?

 

Outputs > Post Notification.

 

Have you actually looked at the workflow elements that are available?

Link to comment

@rob213 As a further tip to @deanishe suggesting taking a look at the Workflow objects available, I wanted to point out that each object, and each Alfred feature has a question mark icon next to it in the preferences. Click this icon to be taken to the relevant documentation for that object.

 

You'll then be able to learn what each object does, how it interacts with others, etc, which should answer many of your questions :)

 

Cheers,
Vero

Link to comment
On 8/26/2020 at 10:40 AM, deanishe said:

You could write a script that generates an alfred://customsearch/ URL based on the active tab and then opens it in Alfred. Good luck figuring out how to insert {query} in the right place.

@deanishe

 

1- script for custom search: OK

 

2- Let's say that I have the following custom URL: how do I “open it in Alfred ?”

alfred://customsearch/https://www.thetimes.co.uk/ 

 

If I enter the above in Chrome → enter → a dialog box appears asking if I want to open it in alfred 4 →  I say yes → error message 

 

image.png.12692ab68c16d0e7b9e3031324c67cb3.png

 

thank you @deanishe

Link to comment
2 minutes ago, rob213 said:

Let's say that I have the following custom URL: how do I “open it in Alfred ?”

alfred://customsearch/https://www.thetimes.co.uk/

 

You have to create a valid URL. Open one of your web searches and click the "Copy URL for sharing" to see a valid one.

 

You’re still going to have to edit almost every search in any case because you aren’t going to be able to automatically add {query} to the right place in the search URL.

Link to comment

 

Objective: when looking at a web site in a browser, I often want to add the URL to my Alfred Custom searches.

 

There are 2 types of Alfred → Pref → Features → Web Search → Custom Search : with or without query which will thus require 2 distinct keyboard maestro macros

 

The keyboard maestro macro below is a composite of both macros (without and with query), the only difference being that in the macro with query I insert an action which runs a regex on the URL replacing all text after the first = sign with {query}

The regex is: 
Search
(\S*?)=.*$
Replace
\1={query}

 

How it works:
While I am in the browser, looking at the website, I trigger the macro and, 
* I end up in the Alfred custom search dialog box
* the URL is automatically pasted (with or without query) (1)
* the cursor is in the title field (2). I just have to complete the title and keyword.

 

207605863_2020-08-30_11-09-03(1).png.fc4b00d5f378617becaaac36ca6e13e2.png

 

2020-08-30_11-09-58.thumb.png.11188d4bffef9a99623d6bdaa68b2b7d.png

 

Link to comment

@rob213 I've merged your threads on this topic. Please don't keep creating new threads about the same thing. Keep it all in one place where it's easier to find. You can edit the thread title if you need to.

 

Also, you should consider exporting the actual macro and posting a link to it, so people can import it instead of having to recreate it based on screenshots.

 

8 minutes ago, rob213 said:

an action which runs a regex on the URL replacing all text after the first = sign with {query}

 

This won't work a lot (perhaps most) of the time. URLs often have more than one parameter, and your macro will delete them.

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