AutoHotkey Community

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

All times are UTC [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: November 2nd, 2009, 11:54 pm 
Offline

Joined: November 2nd, 2009, 11:46 pm
Posts: 4
Location: Seattle
I'm totally new, so please bear with me. I have searched this community for a solution to this very simple problem, but I can't find what I need.

I have a simple script that does a cut and paste operation to move part of a line of text to another location. In this case it is from normal text to a popup in an HTML Help application. The part I have done is to select the text starting from a cursor location to the end of the line, and then use keystrokes to open the pull-down menus to place this text in the popup. This part all works fine.

What I can't figure out how to do is to search the line of text for the character where the text cutting begins. I don't want to do a whole file full at once, because I want to take a second to check that everything looks right before going on to the next line.

The code is attached. All I need is to add a search function for the » character at the beginning of the script.

Code:
#x::
Send, {RIGHT}{SHIFTDOWN}{END}{SHIFTUP}{CTRLDOWN}x{CTRLUP}{SHIFTDOWN}{LEFT}{SHIFTUP}{ALTDOWN}d{ALTUP}e{CTRLDOWN}a{CTRLUP}{CTRLDOWN}v{CTRLUP}

_________________
M Becker


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 3rd, 2009, 12:14 am 
Offline
User avatar

Joined: March 19th, 2008, 12:43 am
Posts: 5480
Location: the tunnel(?=light)
What are you searching? Are you searching the text document itself? Are you searching the Clipboard?

_________________
Image
Try Quick Search for Autohotkey or see the tutorial for newbies.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 3rd, 2009, 1:14 am 
Offline

Joined: November 2nd, 2009, 11:46 pm
Posts: 4
Location: Seattle
Text document.

_________________
M Becker


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 3rd, 2009, 1:22 am 
Offline
User avatar

Joined: March 19th, 2008, 12:43 am
Posts: 5480
Location: the tunnel(?=light)
Well » isn't a non-typical character so you should be able to search the document with it well enough. Are you attempting to copy everything after the » or just certain text? If you're using Notepad to view text files here's an idea:

Code:
ControlGetText, var, Edit1, ahk_class Notepad
MsgBox % SubStr(var,InStr(var,"»")+1) ; should display everything after the '»'


For reference:

ControlGetText
InStr()
SubStr()

_________________
Image
Try Quick Search for Autohotkey or see the tutorial for newbies.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 3rd, 2009, 6:00 pm 
Offline

Joined: November 2nd, 2009, 11:46 pm
Posts: 4
Location: Seattle
Hmmm.... Well, this does something, but not quite what I need. Here's what my script does for me. It's ridiculously simple:

Code:
Send,
{RIGHT]{SHIFTDOWN}{END}{SHIFTUP} ;Moves the cursor one character right and selects everthing from the cursor position to the end of the line.
{CTRLDOWN}x{CTRLUP} ;Cuts selected text to the clipboard.
{SHIFTDOWN}{LEFT}{SHIFTUP} ;Selects the character to the left of the cursor position.
{ALTDOWN}d{ALTUP} ;Opens a menu in my application.
e ; Selects an item from the menu that opens an editor box.
{CTRLDOWN}a{CTRLUP} ;Selects the example text in the editor box.
{CTRLDOWN}v{CTRLUP} ;Pastes the clipboard text into the editor box.


All I really need to do is to get the cursor from where it is in the document to the next instance of the character ».

I use this kind of script very often, so if I could get one example down, I'd be set for life. :D

_________________
M Becker


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 4th, 2009, 12:36 am 
Offline

Joined: November 2nd, 2009, 11:46 pm
Posts: 4
Location: Seattle
I figured out how to make this work. It was too simple.

_________________
M Becker


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], hyper_, JSLover, Kirtman, Leef_me, Miguel, XstatyK, Yahoo [Bot] and 63 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