 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
forkinpm
Joined: 24 Jan 2009 Posts: 13 Location: Aldersbach, Germany
|
Posted: Thu Nov 05, 2009 3:17 pm Post subject: Creating a popup for menu items |
|
|
Hallo!
In my text manipulation I need to be able to:
1. Mark a few words of text with the mouse
2. Add opening and closing brackets to the text marked with the mouse
3. Insert a phrase name at the start of the set of words in brackets & then
4. Insert an end-of-line character after the text selection, to begin a new line.
It is more than a conventional popup menu for item selection and I am finding it difficult understanding how to deal particularly with dealing with points 1 and 2 and combining them into a step.
Has anyone dealt with a similar script?
I have found nothing approppriate on the forum, but perhaps that is just a question of the search terms I used.
Anyone who has developed something similar or can suggest a script I could review to get ideas, I would be mot grateful to hear from.
Kind regards, forkinpm. _________________ I am building my platform based on a set of steps to take my English texts through segmenting into phrases, resequencing segments based on German rules, adding head-words and then translating with my dictionary.
Regards, forkinpm. |
|
| Back to top |
|
 |
Leef_me
Joined: 08 Apr 2009 Posts: 5336 Location: San Diego, California
|
Posted: Thu Nov 05, 2009 9:14 pm Post subject: |
|
|
If you want a popup menu
http://www.autohotkey.com/docs/commands/Menu.htm
here is a script that satisfies goals 1...4 all at once. And example results.
If you want to vary the phrase, then you would need some method to enter or select the phrase. The ways this can be done are almost unlimited. The simplest would seem to be 'menu' (above) or http://www.autohotkey.com/docs/commands/InputBox.htm
| Code: | start_phrase=$$$
left_bracket={
right_bracket=}
end_line=`n
return
f1:: ; <------------ hotkey F1 to perform the action, change as desired
send ^x ; remove the selected text, and place it on the clipboard
sendraw %start_phrase%%left_bracket% ; some characters are special to Ahk, must send them 'raw'
send ^v ; paste the text from the clipboard, back into the editor
sendraw %right_bracket%%end_line% ; some characters are special to Ahk, must send them 'raw'
return
/* example results
this is a test of the emergency broadcasting system
this is a test of the $$${emergency}
broadcasting system
abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz
abcdefghijklmnopqrstuvwxyzabcdefghijk$$${lmno}
pqrstuvwxyzabcdefghijklmnopqrstuvwxyz
*/ |
|
|
| Back to top |
|
 |
forkinpm
Joined: 24 Jan 2009 Posts: 13 Location: Aldersbach, Germany
|
Posted: Wed Nov 11, 2009 12:02 pm Post subject: popup_menu - response |
|
|
Hallo!
I thank you for responding and for the menu.
When I have tested it I will get back to you.
It was a long time since I was in San Diego.
Thanks and regards, forkinp,. _________________ I am building my platform based on a set of steps to take my English texts through segmenting into phrases, resequencing segments based on German rules, adding head-words and then translating with my dictionary.
Regards, forkinpm. |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|