Jump to content
shira

don't try to open urls that are not urls

Recommended Posts

Three or four times a week I run afoul of Alfred's URL search by typing something like:

 

ag.vim 
install.py
config.sh
CSV::Converter

 

etc. etc. Alfred thinks these are all URLs and tries to open them. Could we use a better regex to separate genuine from spurious URLs?

Share this post


Link to post

Note that I don't want to just turn off the URL-recognition option; sometimes I actually do want to type a URL and open it, and that's useful.

Share this post


Link to post

install.py and config.sh are valid URLs, using the TLDs of Paraguay and Saint Helena, respectively. .vim doesn’t appear to be a valid TLD, but since anything can be one, now, there’s a chance it might actually become one. CSV::Converter isn’t detected as a URL, for me.


Point being, I’m not sure what you ask for can be done. You can’t both keep URL detection on and ignore those examples. Unless you require http:// to be typed beforehand, but I doubt most people would want that as a default (might be a toggle, though).


But URL detection should only trigger if you’re typing those words without context (i.e. not looking for files or activating a workflow), so what’s your use case for typing them in that context in the first place? How do they trip you up?

Share this post


Link to post

Vitor is absolutely correct that TLDs are now open ended, so these are valid domains.

 

@shira Have you included file search in your default results? This is a good reason to keep Alfred's default file search behaviour (focused default results, then using the open keyword, or [spacebar] prefix), as this means you'd type [spacebar]install.py to search for that as a file, or install.py to open this as a website.

 

Cheers,

Andrew

 

[Moving to help forum]

Share this post


Link to post

Fair point ... forgot about Paraguay and St. Helena, not to mention the open-ended TLD problem.

 

"install.py" may not be a good example, as I can't think of when I would want to do an Internet search for that without some other words around it. But take "ag.vim", for instance (a Vim plugin). I might want to Google "ag.vim" and read about it, or find it on Github or something. If I type "ag.vim" in the box, I get no option to search the web for it; I see *only* the "open the typed url" option:

 

58c2cad346cb5_MessagesImage(1821263421).png.758d567b870d59102e03604f1297a7b9.png

 

 

I have to type a second word, e.g. "ag.vim repo", to trigger a web search. So I guess it would suffice to at least keep the "search the web" action available below the "open the typed url" action.

 

 

Share this post


Link to post
19 minutes ago, shira said:

I might want to Google "ag.vim" and read about it, or find it on Github or something. If I type "ag.vim" in the box, I get no option to search the web for it; I see *only* the "open the typed url" option:

 

58c2cad346cb5_MessagesImage(1821263421).png.758d567b870d59102e03604f1297a7b9.png

 

I have to type a second word, e.g. "ag.vim repo", to trigger a web search. So I guess it would suffice to at least keep the "search the web" action available below the "open the typed url" action.

 

I recommend @deanishe’s Searchio!, then. Type g ag.vim and you’ll even get other recommendations.

DZxTHw8.png

Edited by vitor

Share this post


Link to post

@shira under Alfred's Advanced preferences, you can find some default modifiers, so you could make alt+return on a result always search in your top fallback (google by default) regardless of whether it matches something.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...