topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Thursday December 12, 2024, 8:56 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Last post Author Topic: WinSendkeys: Latest version thread. Version 3.2.2.0, released 2018-11-04  (Read 48707 times)

Ath

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 3,629
    • View Profile
    • Donate to Member
WinSendKeys Latest Version thread

Application Name WinSendKeys
Version 3.2.2.0
Short Description Send keystrokes and/or mousestrokes to other applications
Supported OSes Windows
Web Page WinSendKeys page
Download Link From the WinSendKeys page
System Requirements
  • An application that needs to be controlled from the 'outside'
  • Some perseverance to get it just right
Version History
  • 3.2.2.0 November 4th, 2018: Added options -i, -s and -sd for setting some delays, see docs for details, fixed exe-version and icon
  • 3.2.1.1 November 3rd, 2018: Now sets errorlevel if Window/-w argument not found (user request), recompiled with latest AutoIt3
  • 3.2.1.0 October 1st, 2011: Added -v related setting to ini and updated the readme with some missing info
  • 3.2.0.1 September 30th, 2011: Added 9 extra commands to multi-window mode when using -f strokesfile
  • 3.1.0.0 June 21st, 2011: Added -v parameter and multi-window mode when using -f strokesfile
  • 3.0.5.0 June 21st, 2011: Disabled left-over debug-messagebox :-[
  • 3.0.4.0 April 22nd, 2011: Minor fixes
  • 3.0.3.0 March 13th, 2011: Support for HWND window handles
  • 3.0.x.0 February 9th, 2011: Start an executable, with optional delay, and feed it the keystrokes
  • 2.6.0.0 February 7th, 2011: Pass keystrokes from the clipboard
  • 2.5.0.0 January 30th, 2011: Read settings from an ini file, read keystrokes from a file
  • 2.0.0.0 January 28th, 2011: MouseClick support, no longer case-sensitive window names required
  • 1.0.0.0 January 24th, 2011: Initial release, send keystrokes to a window
Author Ath


Description
Requested as a codingsnack, on this thread, where mouser eventually suggested a central download to avoid people getting an older version by accident.

Features
Send KeyStrokes and MouseStrokes to another application, starting that application if needed.
Since 3.2.0, the -f strokesfile mode has some minor scripting features to:
- wait for a window to open or close, with timeout
- display a message
- goto a specific labeled scriptline
- gosub a subroutine and return from there

Planned Features
Based on (applicable) user requests.

Usage
Installation
Unzip all files to a subdirectory of your liking. Check out the readme to get acquainted with the command syntax.

Using the Application
Determine what keystrokes and/or mousestrokes to send to an application, and configure that either in a batchfile, 'run-link' or 'external command' from another software tool that supports running a command-line tool. Hint: one of my other tools: WinButtons, has support for sending keystrokes using -send command :)
Use as applicable... ;)

Uninstallation
Remove all files from your computer. Nothing is written to the registry.

Known Issues
Any bugs to report?

« Last Edit: November 04, 2018, 07:23 AM by Ath, Reason: Feature update for setting delays »

jOc

  • Supporting Member
  • Joined in 2006
  • **
  • default avatar
  • Posts: 8
    • View Profile
    • Donate to Member
Hi

I am new to this tool and I can not figure out how to disable debug window appearing.

e.g.:
"C:\Progiz\WinSendKeys\WinSendKeys.exe" -w "Write:" "write something"

I get a window "Debug" "Help: 0 Cmd: 3"... after clicking it, keystrokes are sent...

Thanks.

Ath

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 3,629
    • View Profile
    • Donate to Member
Can you show your WinSendKeys.ini file, please? (wrap it in a [ code=ini] tag, without the extra space, please)

Ath

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 3,629
    • View Profile
    • Donate to Member
Oops, my bad, just checked the source and saw a left-over MsgBox at line 206.

Fixed, please use the attachment to this message, I'll update official download tonight., original download updated.

WinSendKeys 3.0.5
« Last Edit: June 21, 2011, 12:14 PM by Ath, Reason: removed attachment »

jOc

  • Supporting Member
  • Joined in 2006
  • **
  • default avatar
  • Posts: 8
    • View Profile
    • Donate to Member
Ok, tnx for fast response. How do I make file mode (-f) work. Is this text file? What should be in it?
I can not make it work...

Ath

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 3,629
    • View Profile
    • Donate to Member
How do I make file mode (-f) work. Is this text file? What should be in it?
Like you say, it's a textfile that contains the same keystrokes you can use on the commandline. For each new-line there's the same delay as there is between separated keystrokes. You can even use the ## and #% 'MouseStrokes' and #$ 'ClipboardStrokes' if you like.

jOc

  • Supporting Member
  • Joined in 2006
  • **
  • default avatar
  • Posts: 8
    • View Profile
    • Donate to Member
How do I make file mode (-f) work. Is this text file? What should be in it?
Like you say, it's a textfile that contains the same keystrokes you can use on the commandline. For each new-line there's the same delay as there is between separated keystrokes. You can even use the ## and #% 'MouseStrokes' and #$ 'ClipboardStrokes' if you like.

Hm... No matter what I do, I always (and only) invoke help window (nothing more)... As if "-?" I am using the version you sent me above...

Joc.

Ath

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 3,629
    • View Profile
    • Donate to Member
I tried the example WinSendKeys.stro as per the example in that file (with the Scite editor already loaded) and it worked as expected:
WinSendKeys -f WinSendKeys.stro scite

A space (or more) between -f and the filename is mandatory!

jOc

  • Supporting Member
  • Joined in 2006
  • **
  • default avatar
  • Posts: 8
    • View Profile
    • Donate to Member
OK. I finally got it  8) In the file there can not be commands (i.e. switches), only text...

Now that this mystery is solved, I'd like to move to the next problem. How to send keystrokes first to original program (to call the popup) and then to the newly popup-ed window. Does it have to be command line batch?

In any way, I'd like to call it from FARR.

Thanks for bearing with me.

Joc.

Ath

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 3,629
    • View Profile
    • Donate to Member
How to send keystrokes first to original program (to call the popup) and then to the newly popup-ed window. Does it have to be command line batch?
That specific use-case wasn't asked for before, but WSK (WinSendKeys) supports only 1 target at the moment. You could run two WSK command-lines using a batch though, like you suggested.

Ath

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 3,629
    • View Profile
    • Donate to Member
The original download zip-file has been updated, so now I can officially announce:

WinSendKeys 3.0.5 Download from the first message in this thread

What's new:
  • Disabled left-over debug-messagebox :-[ (thanks jOc for reporting that)

Ath

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 3,629
    • View Profile
    • Donate to Member
How to send keystrokes first to original program (to call the popup) and then to the newly popup-ed window.
I took this as a feature request, and added this to WinSendKeys.
It is now possible to specify a few commands in a strokesfile, --window, --exec and --delay, to switch Window/Exe (-w and -x/-xp parameter equivalents) or introduce a delay of some milliseconds. The details are in the readme file, that's just like the source and a compiled exe, included with the download.
I also introduced the -v parameter to enable %environment.var% and @macro@ expansion on keystrokes (default off to avoid compatibility issues). This variable-expansion is now always applied to the -x and -xp commandline-parameters.

So, without much fanfare, but still proud, I announce: WinSendKeys 3.1.0

If you might find any strange issues, or have a feature request or two, please don't hesitate to respond in this thread.

cranioscopical

  • Friend of the Site
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 4,776
    • View Profile
    • Donate to Member
Re: WinSendkeys: Latest version thread. Version 3.1.0, released 2011-06-21
« Reply #12 on: September 28, 2011, 12:49 PM »
@Ath Has this one been covered?

Is there now a way, or what is the best way to send a series of key strokes, then a delay, then another series? Or a series, then wait for an event, then another series?

I tried a couple of ways but obviously haven't understood the correct method.
I want to: -send [CLASS:win] key key… <delay here> key…
in this case would <delay here> be -xd 1000, or can't it be inline like that?

With -f, is it possible to have more than one .stro file by simply using a different name for each?


cranioscopical

  • Friend of the Site
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 4,776
    • View Profile
    • Donate to Member
Re: WinSendkeys: Latest version thread. Version 3.1.0, released 2011-06-21
« Reply #13 on: September 28, 2011, 12:51 PM »
Ath,

I have a friend whom I'd like to set up with a MIMO and the fruits of your labour.

I'm thinking that will need either a couple of days of setup, while we figure out habits and needs, or some kind of Procrustean utility that can auto-generate a fixed screenful of buttons then loop through each one, requesting:
application contextfilepath
a captionforced formattext
an imageforced formatfilepath
executablefilepathparams
keystrokeskeys
the problem with the latter being subsequent editing for omissions, errors etc.

Does that approach make sense to you?

Ath

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 3,629
    • View Profile
    • Donate to Member
Re: WinSendkeys: Latest version thread. Version 3.2.0, released 2011-09-30
« Reply #14 on: September 30, 2011, 04:37 PM »
@Chris and all interested,

I've added some scripting facilities to the [-f strokesfile] feature, so it's now technically possible  to implement your request.
Using such script (an example is included) you can:
- Wait for a window (or title, or exename) to open (--winwait <windowname> [timeout])
- Wait for a window (idem) to close, both with a timeout (--winclose <windowname> [timeout])
- On timeout of the above, either quit or goto a labeled line in the script (--error quit and --error goto <label>)
- Jump to a specific label in the script (--goto <label>)
- Call a subroutine with optional parameters (--gosub <label> [parameter text])
- Return from the subroutine (--return)
- Quit the script (--quit)
- Display a message with optional timeout and parameters support (--msg [timeout,]message text [$params$])

But the difficult part of your request is to interact with the user, Windows and it's applications to determine what to send when and where, and what to wait for, to get the desired 'workflow'.
At least the techy-geek baseline is here :)

Release is available at the first message in this thread, so, tada:


cranioscopical

  • Friend of the Site
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 4,776
    • View Profile
    • Donate to Member
Re: WinSendkeys: Latest version thread. Version 3.2.0, released 2011-09-30
« Reply #15 on: September 30, 2011, 11:30 PM »
Holy Moses, you don't waste any time do you?
That's amazing.

Thank you very much indeed!

Off to download now, all you have to do is sit back and wait for the dumb questions to roll in  ;)

Ath

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 3,629
    • View Profile
    • Donate to Member
I've added some small changes to WinSendKeys, so the -v commandline parameter can be set from the (optional) ini file, and updated the documentation with all settings that can be configured in the ini file.

Release is available at the first message in this thread, so, tada:


cranioscopical

  • Friend of the Site
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 4,776
    • View Profile
    • Donate to Member
I've added some small changes to WinSendKeys, so the -v commandline parameter can be set from the (optional) ini file, and updated the documentation with all settings that can be configured in the ini file.

More good stuff!

It works very nicely for me now that I realize that my .stro file needs to be in the folder with WinButtons and not in the sub-folder with WinSendKeys.
I'm calling the .stro file from a button with
command1 = -send -f PSnewLayer.stro -v [CLASS:Photoshop]
which finds WinSendKeys in the sub-folder but not the .stro

Clearly, I have as good a grasp on this as usual. I wonder, how ever did I manage to earn a living?

Ath

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 3,629
    • View Profile
    • Donate to Member
which finds WinSendKeys in the sub-folder but not the .stro
-cranioscopical (October 01, 2011, 12:46 PM)
Ah, yes, the -send command of WB doesn't change directory to the WinSendKeys (WSK) folder, and by specifying just a filename without path, WSK expects the file to be in the current directory, and that is the WB directory as you already found out.

I could change that, but I'm not sure it would make you any happier ;D

cranioscopical

  • Friend of the Site
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 4,776
    • View Profile
    • Donate to Member
I could change that, but I'm not sure it would make you any happier ;D
No, it's fine for me. It's rather like my car, I can travel further once I remember where I last saw it.   :)

mitzevo

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 462
  • Control is power
    • View Profile
    • Donate to Member
Thanks for the tool, very good!  :-[
The clock is running. Make the most of today. Time waits for no man. Yesterday is history. Tomorrow is a mystery. Today is a gift. That's why it is called the present.

daddydave

  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 867
  • test
    • View Profile
    • Donate to Member
[EDITED] Nevermind, I figured it out, now I see <WindowName> is a required field for obvious reasons.

Thanks for making this, somehow I missed this tool in 2011, I predict I will find some nice uses for it!
« Last Edit: July 14, 2012, 09:48 AM by daddydave »

RichTWebGuy

  • Supporting Member
  • Joined in 2012
  • **
  • Posts: 28
    • View Profile
    • Donate to Member
Re: WinSendkeys: Latest version thread. Version 3.2.1, released 2011-10-01
« Reply #22 on: September 04, 2013, 11:13 AM »
When I put a WinSendKeys command in a TCC batch file, the shell changes the window title to append the currently running command. So now the windowname string I specified after the -w switch is also on the TCC console and WinSendKeys sends to wrong window.

cranioscopical

  • Friend of the Site
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 4,776
    • View Profile
    • Donate to Member
Re: WinSendkeys: Latest version thread. Version 3.2.1, released 2011-10-01
« Reply #23 on: September 04, 2013, 08:12 PM »
Insert Quote
When I put a WinSendKeys command in a TCC batch file, the shell changes the window title to append the currently running command. So now the windowname string I specified after the -w switch is also on the TCC console and WinSendKeys sends to wrong window.

Can't you have your TCC batch file specify what its (own) window title should be (WINDOW command, perhaps)?
« Last Edit: September 05, 2013, 03:18 PM by cranioscopical »

SleepingWolf

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 118
    • View Profile
    • Read more about this member.
    • Donate to Member
I love the idea of what this program does but right now I am very time-short and can't quite make out what exactly it does. Unfortunately this page and your website are very technical (and could use a fair bit of white-space for easier reading) but trying to find a good scenario for use for someone in a rush is very difficult. A youtube video and maybe a quick explanation/ walk-through regarding the use of a couple of specific applications, hotkeys and data files would help here.

  For example, I would like to be able to control SMPlayer which is set with the '<-' and '->' cursor keys to jump back and forth and the "#" key which is set to pause/continue.
  Ideally I'd like to be typing in OpenOffice Writer and press "#" to pause/continue the playback without the focus switching to SMPlayer or the '#' getting typed in OpenOffice Writer.
  Can this be done? If so how? Which files will I have to create or edit to make it work and what should their contents look like? This high level sort of explanation is what I think your website lacks, though I'm sure it doesn't lack for technical information!!!

  Thanks in advance for any help here.
-------------------------------------------

Question everything, use a fact-checker.
Respect yourself and respect others.
Peace out!