microsoft / PowerToys

Windows system utilities to maximize productivity
MIT License
110.91k stars 6.53k forks source link

Macros/Snippets in PowerToys Run (with ability to execute) #15032

Open chrislockard opened 2 years ago

chrislockard commented 2 years ago

Description of the new feature / enhancement

Add snippet support to PowerToys Run analogous to the Snippets and Text Expansion feature of Alfred for macOS, e.g.

sn <label>

Would insert user-defined text identified by

Scenario when this would be used?

This would be used to insert repetitive text anywhere a user does so, for instance:

The possibilities are limitless 🚀

Supporting information

I think the best supporting information is provided by AlfredApp's help page on the feature.

crutkas: this should be larger and include concepts like search engine launch. I think we should have some easy pre-defined things like "{browser} https://stackoverflow.com/search?q={0}" so so foo would just properly launch

crutkas commented 2 years ago

This wouldn't be PT Run, this would be KBM and tracked via #5668

chrislockard commented 2 years ago

Hi @crutkas, I’m making the presumption that powertoys Run is emulating more powerful launchers - with Alfred being the most feature full - and not simply spotlight. If this isn’t the intent behind Run then snippet functionality probably is out of scope.

Maybe I don’t understand KBM enough, but as an Alfred user on macOS this seems to squarely fall into Run’s functionality. I’m not asking for key re-mapping, I’m asking for a mechanism to launch Run and then use a shortcut or prefix to browse and insert a user-defined string at the cursor. Run currently uses a similar pattern for executing commands.

crutkas commented 2 years ago

I think

daxliniere commented 2 years ago

Hey gang, In addition to my custom web searches from PT Run, I'd also like to request command line from there, too. For example: cmd schtasks.exe /Run /TN "\Microsoft\Windows\Servicing\StartComponentCleanup"

Thanks for your hard work! :)

daxliniere commented 2 years ago

Actually, PowerShell might be useful, too.

nortakales commented 2 years ago

I have a ton of custom searches configured in Chrome. Having PowerToys run only search via my default search engine is very specific and not very useful compared to just sending that query to my default browser, and letting the browser decide what to do with it. The end result is either: A. the query matches one of my custom searches and my browser will properly handle that or B. it won't match anything and will fall back to a search via my default search engine anyway.

So what would really be nice is a way to just send any text string to my default browser, and let it handle what to do. That is what some of the issues closed as duplicates of this one are asking for I think. Reading through the description of the issue, I don't get the sense that this will help achieve what we're looking for.

Is there another issue covering what I'm talking about? Should we reopen one of the closed duplicates?

As an example, I don't see how https://github.com/microsoft/PowerToys/issues/17499 is a dupe of this one. The two feature requests are different.

crutkas commented 2 years ago

@nortakales if you have a macro that opens up the browser with the target URL you want, it does exactly what you want in a far more extensible manner. PT Run at no level needs to understand what website or browser or if the query was used to send to notepad.

PT Run will not get into the business of ever deeply understanding how all the different search engines work. If a community member wants to maintain that plugin, it is a plugin based system.

What is being proposed above would accomplish search engines and far more.

nortakales commented 2 years ago

@crutkas I 100% agree with everything you said up to "What is being proposed above would accomplish search engines and far more."

The initial ask in this issue:

sn <label> Would insert user-defined text identified by at the cursor's position.

doesn't seem to support something like web <whatever> opening my default browser with <whatever> in the URL/search bar. It seems like this issue is just asking for simple text expansion. What am I missing?

marcosllinares commented 2 years ago

I just want to open PT Run, type "youtube funny cats" and have this open a chrome tab on youtube with the search for to easily watch a kitty video 😭 Is it too much to ask?

rcmaehl commented 2 years ago

I've created a proof of concept over at rcmaehl/PowerToysMacros

image

saurcey commented 1 year ago

Super interested in this feature. Have a bunch of medical search engines I use on a daily basis and the ability to define searches such as u hypertension workup to query uptodate.com or p sarcoma guidelines to query pubmed.

The rcmaehl/PowerToysMacros is a solid short-term solution but giving users the ability to website they'd like to query like in other launchers is the ideal long-term solution. And typing macro: u hypertension workup just isn't as clean

Side note: this and #3600 seem to be really similar features being requested, maybe they could be rolled up into one?