Sign in to follow this  
Followers 0
reverse

Send key to program

4 posts in this topic

Hi guys.

I made a script that helps me a lot in what I'm dealing with but still does not make the whole work for me.

#include
#include
Local $file = FileOpen("lista.txt", 0)

; Check if file opened for reading OK
If $file = -1 Then
MsgBox(0, "Error", "Unable to open file.")
Exit
EndIf


; Read in lines of text until the EOF is reached
While 1
Local $line = FileReadLine($file)

If @error = -1 Then MsgBox(262144,"...", "...") ExitLoop

Clipput($line)


GUICreate("H", 250, 150,900,200,1,$WS_EX_TOPMOST)
GUICtrlCreateLabel($line, 30, 10)
$okbutton = GUICtrlCreateButton("OK", 70, 70, 60)
GUISetState(@SW_SHOW)


While 1
$msg = GUIGetMsg()

Select
Case $msg = $okbutton
GuiDelete("H")
ExitLoop
EndSelect
WEnd





;MsgBox(262144, "Line read:", $line)
WEnd



FileClose($file)

The script reads lines from txt file and copies the lines to clipboard.

Skips to next line when I press OK button.

That works great but I would like to add one more funcionality to it.

I would like it to send Ctrl+Enter to Photoshop.exe process as well when OK button is pressed.

The photoshop window is not minimized but not on top (I don't know if it matters at all ;) )

Sorry for my english.

Thx for your help.

Share this post


Link to post
Share on other sites



Try it with a new little test script and use ControlSend as command.


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Try it with a new little test script and use ControlSend as command.

Thx for help.

Managed to solve the problem myself :D

Edited by reverse

Share this post


Link to post
Share on other sites

That is always the best solution!


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
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
Sign in to follow this  
Followers 0