Samy_rio has asked for the wisdom of the Perl Monks concerning the following question:
Hi monks, I need to get line number of current cursor position in a file which is opened in any editor like "UltraEdit".
Another thing is I need to get the selected text in a variable. I have tried as:
use Win32::GuiTest qw(:ALL :SW); $Win32::GuiTest::debug = 0; my ($ultra) = FindWindowLike(0, "^Ultra"); print "$ultra\t", GetWindowText($ultra), "\n"; SetForegroundWindow($ultra); SendKeys("^+{HOME}"); SendKeys("^c"); my $str = SendKeys("^v"); #Selected text to be stored in $str variab +le (Not Working) print $str;
I can select the text but I can't store it in a variable. My questions are:
1. How can I get the line number of current cursor position?
2. How can I get the selected text in a variable? Please suggest me.
Thanks in advance.
Regards,
Velusamy R.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Get the line number of current cursor position
by ikegami (Patriarch) on Sep 07, 2006 at 06:45 UTC | |
|
Re: Get the line number of current cursor position
by mreece (Friar) on Sep 07, 2006 at 06:55 UTC |