Jump to content

is it possible to pass a query to an app with a search window instead of a website ?


Recommended Posts

I often use Alfred to query web sites, for example

https://www.dict.cc/?s={query} for the dict.cc dictionary site

I converted the above URL to an app using Fluid.

I was wondering is there is a way to pass on queries the app instead of  the URL

The advantage is that when I use the URL query with a web site, a new tab is opened each time. If I use the app form, I just work in one window.

thanks in advance for your time and help

Link to comment
6 hours ago, rob213 said:

I often use Alfred to query web sites


No, you use Alfred to open a URL, which is in a format that the specific website takes as a query.

 

The distinction is important because the same logic applies to apps. There’s no single command you can use to “query an app”; whether that’s possible at all and how it’s done is entirely dependent on the app. If it can be done, they usually provide easy-to-find documentation on how to do it, which if you share we can use to help build a Workflow.

Link to comment
2 hours ago, rob213 said:

but @vitor says that it is not possible

 

Vítor said there’s no universal way to search applications. But you don’t want to do that anyway. You want to open a URL in a specific tab in a Fluid app.

 

Unfortunately, Fluid doesn't give you any way to do that. It has a few APIs, but nothing for manipulating tabs or windows. You might be able to find a similar application (site-specific browser) that does support such APIs or (more likely) doesn't support multiple tabs, so everything is always opened in the same one.

Edited by deanishe
Link to comment
5 hours ago, vitor said:

No, you use Alfred to open a URL, which is in a format that the specific website takes as a query.

 

@vitor @deanishe @Andrew

 

You are absolutely right @vitor. The reason I asked is that the app I am using is a hybrid: a website converted to an app using Fluid. At the top I can see the actual web site in a format which seems amenable to a query. The image below is from the dict.cc Fluid “app”, not a browser.

 

The advantage of this approach (which can be extended to any website converted to an app with Fluid) is that no “tab” is opened each time I perform a search, contrary to a browser, which opens a tab for each search.

In other words, if I lookup words 100 times (either directly in Chrome or using Alfred's query) , I will end up with 100 tabs in Chrome (one of the reasons why people end up with so many open tabs), as opposed to the Fluid version which is limited to one single window/tab which is refreshed with each search.

 

A solution to this issue would expand Alfred's query power.

 

 

 

 

image.thumb.png.4dd5ddbf2830469a80f2be7430eec72a.png

Edited by rob213
Link to comment
1 hour ago, rob213 said:

no “tab” is opened each time I perform a search, contrary to a browser, which opens a tab for each search.

 

In my tests, a new tab is opened every time you tell a Fluid app to open a URL (unless you paste it into the location bar).

 

Is it possible that you've hidden the tab bar?

Link to comment
12 minutes ago, deanishe said:

In my tests, a new tab is opened every time you tell a Fluid app to open a URL (unless you paste it into the location bar).

 

Is it possible that you've hidden the tab bar?

 

I did 2 searches as per below. I do many per day. I have never closed a tab

 

As you can see, the tab is refreshed. No tab is added or opened.

 

I do not paste anything. I open the app → enter the term in the search field.

 

Yes, the app is set to View → Tab Bar as confirmed on the image below.

 

thank you for testing.

 

2020-11-08_21-35-48.thumb.png.660901b900259502d09e8a53d387a802.png

 

 

2020-11-08_21-37-48.thumb.png.b42583b2b534faba649959af9074c0ef.png

 

Edited by rob213
Link to comment
29 minutes ago, rob213 said:

If I edit the query twice (first with alfred, then with bear), the tab is refreshed with the new search. No new tab is opened.

 

Yes. I did say "unless you paste it into the location bar".

 

The point is, when you programmatically ask a Fluid app to open a URL, it always creates a new tab.

 

And that's what matters when it comes to scripting an app (which is what you're asking about), not what happens when you do it with keyboard and mouse.

Link to comment

As long as the app's toolbar is visible, you can still achieve what you want by simulating keypresses.

 

Here’s a simple workflow that should mostly work. It assumes your Fluid app is called DictCC. If it’s not, you’ll have to change APP_NAME in the workflow’s configuration. There are some other settings you might also want/need to change.

 

Link to comment
53 minutes ago, deanishe said:

As long as the app's toolbar is visible, you can still achieve what you want by simulating keypresses.

 

Here’s a simple workflow that should mostly work. It assumes your Fluid app is called DictCC. If it’s not, you’ll have to change APP_NAME in the workflow’s configuration. There are some other settings you might also want/need to change.

 

 

Thank you. Your work is greatly appreciated.  Unfortunately, when I run the workflow, dictcc opens but in the previous search. I tried changing all kinds of settings but it did not work.

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