rob213 Posted November 8, 2020 Share Posted November 8, 2020 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
vitor Posted November 8, 2020 Share Posted November 8, 2020 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. rob213 1 Link to comment
deanishe Posted November 8, 2020 Share Posted November 8, 2020 7 hours ago, rob213 said: 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. So what you specifically want to do is open a URL in the first tab of a Fluid app’s window? rob213 1 Link to comment
rob213 Posted November 8, 2020 Author Share Posted November 8, 2020 47 minutes ago, deanishe said: So what you specifically want to do is open a URL in the first tab of a Fluid app’s window? yes, with a query, but @vitor says that it is not possible. thank you both Link to comment
deanishe Posted November 8, 2020 Share Posted November 8, 2020 (edited) 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 November 8, 2020 by deanishe Link to comment
rob213 Posted November 8, 2020 Author Share Posted November 8, 2020 (edited) 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. Edited November 8, 2020 by rob213 Link to comment
deanishe Posted November 8, 2020 Share Posted November 8, 2020 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? rob213 1 Link to comment
rob213 Posted November 8, 2020 Author Share Posted November 8, 2020 (edited) 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. Edited November 8, 2020 by rob213 Link to comment
rob213 Posted November 8, 2020 Author Share Posted November 8, 2020 @deanishe perhaps this setting in the fluid app Link to comment
rob213 Posted November 8, 2020 Author Share Posted November 8, 2020 @deanishe In the Fluid app, I can generate a search by editing the query in the tab bar 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. Link to comment
deanishe Posted November 8, 2020 Share Posted November 8, 2020 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. rob213 1 Link to comment
rob213 Posted November 9, 2020 Author Share Posted November 9, 2020 8 hours ago, deanishe said: programmatically ask a Fluid app to open a URL, it always creates a new tab. I understand. thank you @deanishe Link to comment
deanishe Posted November 9, 2020 Share Posted November 9, 2020 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. rob213 1 Link to comment
rob213 Posted November 9, 2020 Author Share Posted November 9, 2020 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
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