Skip to content

Need help creating context menu with input for web search #677

Answered by RubicBG
mtdevdev asked this question in Q&A
Discussion options

You must be logged in to vote

you can use this as a basis:

item(title='Browse' tip='Seaarch in Google with your default browser'
	cmd=if(input('Web Search', 'Enter a search term:') and input.result().len()>0, 'https://www.google.com/search?q=' + input.result, msg('No search term!', 'Web Search', msg.warning)) )
item(title='Browse' tip='Open a URL with your default browser'
	cmd=if(input('Open Web', 'Enter a URL:'), if(str.contains(input.result, 'www'), input.result, msg('Invalid URL!', 'Open Web', msg.warning)), msg('No URL!', 'Open Web', msg.warning)) )

I have no idea

  • how would you want to filter out a URL from a regular string
  • which search engine do you want to use
  • which browser do you want to execute the command
    t…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@mtdevdev
Comment options

Answer selected by mtdevdev
Comment options

You must be logged in to vote
1 reply
@mtdevdev
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants