AutoHotkey Community

It is currently May 26th, 2012, 11:34 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: November 5th, 2009, 4:17 pm 
Offline

Joined: January 24th, 2009, 3:22 pm
Posts: 13
Location: Aldersbach, Germany
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 5th, 2009, 10:14 pm 
Online

Joined: April 8th, 2009, 7:49 pm
Posts: 6068
Location: San Diego, California
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


*/


Report this post
Top
 Profile  
Reply with quote  
 Post subject: popup_menu - response
PostPosted: November 11th, 2009, 1:02 pm 
Offline

Joined: January 24th, 2009, 3:22 pm
Posts: 13
Location: Aldersbach, Germany
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.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], Leef_me, Pulover, rbrtryn, XstatyK and 52 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group