Jump to content

ControlSend confusion


7121
 Share

Recommended Posts

i'm have a small problem understanding ControlSend.

I have notepad2 so this might a little bit harder.

What i want to do is copy a title of a certain window (ex: firefox) into the notepad file. Unfortunately, i do not want the notepad window to pop up, basically i do not want the window to be active during teh pasting.

KEEP IN MIND it's NOTEPAD2 so yeah =/.

Every time i do send it to the notepad, the window keeps popping back up so yeah.

Link to comment
Share on other sites

well the thing is that the NOTEPAD or TXT file is already open and has to keep track on how the firefox title changes. Basically its recording a list of the firefox titles that pop up. So yeaah...

but please, do enlighten me by WRITING DIRECTLY?

do u mean actually writing to the txt file without opening it??? o_0?? is that possible???

*I still want to know how to use ControlSend though for future references

Link to comment
Share on other sites

You can find all this in the help file. It's 100% better to simply write the txt file.

Look at this code:

HotKeySet("{esc}",'_exit')

$FilePath = ''
$FirefoxClass = '[CLASS:FirefoxWindow]'
$sOldTitle = ''
$FileHandle = FileOpen($FilePath,1)

While 1
    $s_Title = WinGetTitle($FirefoxClass)
    If $s_Title <> $sOldTitle Then 
        FileWriteLine($FileHandle,$s_Title)
        $sOldTitle = $s_Title
    EndIf
    Sleep(500);
WEnd

Func _exit()
    FileClose($FileHandle)
    Exit
EndFunc

What you need to do before you run that, is check Firefox properties with Autoit Window Info. (You find it at Start->All programs->Autoit v3->Autoit Window Info). You need to check Firefox's class under Basic Window Info. Once you have it, replace 'FirefoxWindow' in $FirefoxClass, since I made that up.

Read the following in the help file:

FileOpen

FileWrite

FileWriteLine

Window Special Title Definition

Link to comment
Share on other sites

You can find all this in the help file. It's 100% better to simply write the txt file.

Look at this code:

HotKeySet("{esc}",'_exit')

$FilePath = ''
$FirefoxClass = '[CLASS:FirefoxWindow]'
$sOldTitle = ''
$FileHandle = FileOpen($FilePath,1)

While 1
    $s_Title = WinGetTitle($FirefoxClass)
    If $s_Title <> $sOldTitle Then 
        FileWriteLine($FileHandle,$s_Title)
        $sOldTitle = $s_Title
    EndIf
    Sleep(500);
WEnd

Func _exit()
    FileClose($FileHandle)
    Exit
EndFunc

What you need to do before you run that, is check Firefox properties with Autoit Window Info. (You find it at Start->All programs->Autoit v3->Autoit Window Info). You need to check Firefox's class under Basic Window Info. Once you have it, replace 'FirefoxWindow' in $FirefoxClass, since I made that up.

Read the following in the help file:

FileOpen

FileWrite

FileWriteLine

Window Special Title Definition

hmmm, can it be consecutively??? as in , it can keep adding a NEW line of titles everytime....
Link to comment
Share on other sites

ooh i seee. THANKS ^__^. unfortunately this forum does not do REP =/.

OH, i manage to get the ControlSend to work =). Switched back to notepad though instead of notepad 2 ^_^.

I do however have a new question....

does anyone know if ControlClick work on firefox (minimized) ???

Link to comment
Share on other sites

ooh i seee. THANKS ^__^. unfortunately this forum does not do REP =/.

OH, i manage to get the ControlSend to work =). Switched back to notepad though instead of notepad 2 ^_^.

I do however have a new question....

does anyone know if ControlClick work on firefox (minimized) ???

Go look in example scripts and look for FF.au3.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...