|
Add an Entry to the context menu
|
Reply to this subject
Start a new subject
 
Refresh page
| Posted by |
WillFa
USA (517 posts) bio
|
| Date |
Wed 19 Nov 2008 05:07 AM (UTC) [ quote
] |
| Message |
I wanted to add a menu item to the right-click menu so that I could highlight some output, right click, and send that to an alias.
for example,
function qSearch(Text)
for x in Text:gmatch("%w+") do
Send("exa " .. x)
Send("search " .. x)
end
end
I can figure out the code to get the selection length, and such, to supply that to the function, but I can't see if there's a way so that while I've got my hand on the mouse and highlighting the output, if I could just right click and execute that script, or another script that gets the selection and fires the above.
Thanks for any help.
| top |
|
| Posted by |
Worstje
Netherlands (867 posts) bio
|
| Date |
Reply #1 on Wed 19 Nov 2008 06:20 AM (UTC) [ quote
] Amended on Wed 19 Nov 2008 06:21 AM (UTC) by Worstje
|
| Message |
I don't think that's possible currently.
Also, if you want to call an alias, you may want to use Execute() instead of Send(). And that loop doesn't seem really sane either, unless you want to call two aliases per selected word, rather than one alias depending on the menu item selected. | top |
|
| Posted by |
WillFa
USA (517 posts) bio
|
| Date |
Reply #2 on Wed 19 Nov 2008 06:56 AM (UTC) [ quote
] |
| Message |
exa (examine) and search are mud commands. It's basically to hit all the nouns in a block of text to get their descriptions. It's a brute force method to questing on 3Kingdoms.
| top |
|
| Posted by |
Nick Gammon
Australia (18,797 posts) bio
Forum Administrator |
| Date |
Reply #3 on Wed 19 Nov 2008 10:40 PM (UTC) [ quote
] |
| Message |
You can't add to the context menu, but you can build your own menu that appears when you do Ctrl+Left-click.
Simply make an alias to do what you want, give it a name, and check "Menu". It then appears in that menu (by the name you give it). |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | top |
|
| Posted by |
Worstje
Netherlands (867 posts) bio
|
| Date |
Reply #4 on Thu 20 Nov 2008 (UTC) [ quote
] |
| Message |
I never saw that menu option in the alias window. It -does-, however, explain how the hell to fill that menu I occasionally managed to randomclick into appearance.
/me is fully content now! | top |
|
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.
1,748 views.
Reply to this subject
Start a new subject
 
Refresh page
top
Comments to:
Gammon Software support
Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )