Cheng
-
Posts
4 -
Joined
-
Last visited
Content Type
Blogs
Gallery
Downloads
Events
Profiles
Forums
Articles
Media Demo
Posts posted by Cheng
-
-
23 minutes ago, vitor said:
A Script Filter is the wrong solution. You should have a Keyword connected to a Run Script connected to Open URL. Yes, that is more nodes, but will actually be simpler code and will be more efficient since it won’t run with every character press.
When asking for help with your workflow please also post a link a to it. We’re not seeing the whole picture and the problem may be somewhere you’re not thinking of. Also give us your Alfred version.Thanks Vitor!
-
22 minutes ago, Andrew said:
You'd be better off just using a keyword input to capture the query, then run it through a Run Script which does your processing. This simplifies things as you just output the URL from the script which will be used as the input of the Open URL.
You could even do this without scripting using:
Keyword input -> Replace util (replace http) -> Process util (lower case) -> Open URL.
Cheers,
Andrew
Really appreciate your help "Keyword input -> Replace util (replace http) -> Process util (lower case) -> Open URL" => this one is much easier. The "Process util" is called "Transform" in my alfred.
-
Newbie question here: I have created a script filter to convert a {query} to lower case and replace https with http:
import sys query = "{query}" query = query.lower() if query.startswith('https://'): query = query.replace('https://', 'http://') sys.stdout.write('{"items":[{"title": "test", "args":"'+query+'"}]}')
Then, I'd like to pass the processed {query} to an open url action. (See the attached image below)
After I enter the keyword: ala a_url, and press enter, nothing happens. I can see the debug console printing out the correct JSON, but I am not sure how to pass the processed {query} to the "open url action", please help
How to pass a processed {query} to an open url action
in Workflow Help & Questions
Posted