Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Default Action #153

Closed
badWithUsername opened this issue Feb 11, 2020 · 6 comments
Closed

Feature Request: Default Action #153

badWithUsername opened this issue Feb 11, 2020 · 6 comments
Assignees
Milestone

Comments

@badWithUsername
Copy link

What do you think about having the option for LL to execute a default action on text in the input box if no matches are found for it and/or upon a hotkey press?

I, for one, would use it send the text to cmd or run.

@lintalist
Copy link
Owner

It wouldn't be that difficult to add, but you could probably just as easily create a new bundle, say we call it AlwaysRunBundle.txt and add that to the AlwaysLoadBundle setting. And make a snippet of Part1 + Script that uses Part1 - if you press the hotkey you defined you get an inputbox and do with it what you want - because it is always loaded due to AlwaysLoadBundle it should work everywhere and probably a tad faster as it bypasses the heavy 'search gui'

- LLPart1: [[input=Enter Command]]
  LLPart2: 
  LLKey: ^f12
  LLShorthand: 
  LLScript: #NoEnv
[[llpart1]]
MsgBox % llpart1

@badWithUsername
Copy link
Author

badWithUsername commented Feb 12, 2020 via email

@lintalist
Copy link
Owner

OK but how do you decide what and where it should go? Should it always launch a script e.g.
run whateveryoutyped or something else, how to select what to do with the text you entered?

I can imagine you can prepare an INI file with "Actions" so you enter text, say "ping 127.0.0.1", you hit enter and a menu? or the Choice plugin Gui pops up and you select

AHK: ping 127.0.0.1
CMD: ping 127.0.0.1
Google: ping 127.0.0.1

and the ini looking something like this

[ahk]
code=Run %query%
[cmd]
code=runwait %comspec% /k %query%
[google]
code=Run google.ahk %query% 

@badWithUsername
Copy link
Author

badWithUsername commented Feb 12, 2020 via email

@lintalist
Copy link
Owner

I can add it but will do so using three hidden settings as I think it won't be used by the average user.

  • QueryAction = 0 or 1 (off/on)
  • QueryScript = path to script to run e.g. RunQuery.ahk %query%
  • QueryHotkey = optional hotkey, e.g. F12

@lintalist
Copy link
Owner

Make a backup of lintalist.ahk and include\readini.ahk just in case, unpack files with folder structure to lintalist folder, restart, edit settings.ini and change QueryAction=0 to QueryAction=1 and restart.

Open lintalist search, type something, press F12 and it will run RunQuery.ahk passing on what you typed. If you type something and there are no results and hit enter it will do the same. If there are results it will of course use the first of selected snippet

So you will have to modify RunQuery.ahk to your liking of course but in principle it should work.

📁 lintalist-runquery.zip

Somewhat related: https://github.com/lintalist/lintalist/blob/master/plugins/readme-howto.txt#L129

@lintalist lintalist self-assigned this Apr 11, 2020
@lintalist lintalist added this to the 1.9.12 milestone Apr 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants