parsing clipboard text to the input text field of another application Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
mirHadi
Posts: 29
Joined: 18 Jul 2021, 07:36

parsing clipboard text to the input text field of another application

18 Jul 2021, 07:48

Hello

In Potplayer, in order to use bobylon translator, first I copied the word to clipboard, that PotPlayer does.
then I used this example script for clipboard change event :

Code: Select all

#Persistent
OnClipboardChange("ClipChanged")
return

ClipChanged(Type) {
    ToolTip Clipboard data type: %Type%
    Sleep 1000
    ToolTip  ; Turn off the tip.
}
[Mod edit: [code][/code] tags added.]

It was successful.
now I want AHK script to run specific application ( in this case Babylon translator) and fill the input box of it with the clipboard text. is it possible to do that?

thank you
Last edited by gregster on 18 Jul 2021, 07:49, edited 1 time in total.
Reason: Topic moved from 'Scripts and Functions'.
AHKStudent
Posts: 1472
Joined: 05 May 2018, 12:23

Re: parsing clipboard text to the input text field of another application

18 Jul 2021, 08:14

Yes, but it depends on their software on what method will work

first get the name of the control, see if anything happens if you place your mouse on the area in their software you put the word and press q

Code: Select all

q::
    MouseGetPos,,,,cont
    MsgBox, % cont
ExitApp
if it gives you a control name you could send text to that box using https://www.autohotkey.com/docs/commands/ControlSend.htm
mirHadi
Posts: 29
Joined: 18 Jul 2021, 07:36

Re: parsing clipboard text to the input text field of another application

19 Jul 2021, 10:12

Thank you

Is this code equivalent to "Focused Control:" field in "Window Spy" window?

PS: would you please give me a hit about controlsend?

my code Is like this:

Code: Select all

IfWinActive ahk_exe ahk_exe PotPlayerMini64.exe

#Persistent
return
OnClipboardChange:
WinActivate, ahk_exe Babylon.exe
ControlSend,, Tiger.{Enter}
return
the Control name of Babylon app is this "ClassNN: Internet Explorer_Server1", according to window spy.
and I want to paste the word "Tiger" in the text box of Bobylon( for now, that would be replace by clipboard word).
the doc says that It can be blank the control argument but can't make it work.
mirHadi
Posts: 29
Joined: 18 Jul 2021, 07:36

Re: parsing clipboard text to the input text field of another application

19 Jul 2021, 12:47

The right command for me to work was "Control" like:
Control, EditPaste, % Clipboard, ControlName, WinTitle

and It worked. :)
a couple of questions:

- I need the previous word in target text filed to be deleted first, can I clear the text box before pasting in the new clipboard text?
- {Enter} , where should I put it ?

thank you
AHKStudent
Posts: 1472
Joined: 05 May 2018, 12:23

Re: parsing clipboard text to the input text field of another application  Topic is solved

19 Jul 2021, 16:48

mirHadi wrote:
19 Jul 2021, 12:47
The right command for me to work was "Control" like:
Control, EditPaste, % Clipboard, ControlName, WinTitle

and It worked. :)
a couple of questions:

- I need the previous word in target text filed to be deleted first, can I clear the text box before pasting in the new clipboard text?
- {Enter} , where should I put it ?

thank you
You could use controlSetText to set it to blank https://www.autohotkey.com/docs/commands/ControlSetText.htm
mirHadi
Posts: 29
Joined: 18 Jul 2021, 07:36

Re: parsing clipboard text to the input text field of another application

05 Aug 2021, 04:55

Hello

There is an search icon in babylon app UI but cant' get it class (ID) to make it pressed when sendin a word to the control.
how can I get that button class?
thank you
babylon.JPG
(31.35 KiB) Downloaded 25 times

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Descolada, Joey5, matt101, Thorlian and 165 guests