Windows 7 Forums

Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: 'SendKeys' automating wannabe with lack of reliable info

07 Jul 2017   #1
Oakers

Colorado
 
 
'SendKeys' automating wannabe with lack of reliable info

I'm writing a batch file to transcribe sound files while I'm sleeping, and I've found I just don't have the expertise to do it alone.

Here's what I've got now (6 hours in [I'm not really a programmer]):

Code:
cd ..\..
&& cd Program Files (x86)
&& cd audacity
&& start audacity.exe

#Dice audiofile, use pitchdetect on pieces, store solutions in file


&& cd ..
&& cd Finale NotePad 2012
&& start Finale NotePad.exe

#Output file into cleft 10 lane freeway

I actually made some progress, saying to myself (Yee hee) I'll be done by tomorrow, the 1200 songs I have to transcribe by next week, but I found my roadblock and I'm sitting at her right now. (Which, the why I didn't post under the audio thread is the actual question doesn't involve audio).

Writing the next part would require false keypad strokes to be registered to programs keyboard shortcuts. Someone on a forum said 'Sendkeys'! and that was five hours ago, and I have just not been able to get it to work. I guess you have to use .vbs and I have not been able to get one of those to run.

Here are some examples of tests I have run to 1. verify 'SendKeys' is a real thing and 2. learn syntax:


Test1:

Code:
Set oWshShell = CreateObject("WScript.Shell")
oWshShell.sendkeys("Hello World")

##.bat

Test2:

Code:
  @echo off
cls
color 0a
:loop
%SendKeys% {ENTER}
timeout /t 1 /nobreak >nul
goto :loop

##.bat

Test 3:


Code:
@if (@CodeSection ==  @Batch)  @then

  @echo off
    set SendKeys=CScript //nologo //E:JScript "%~F0"
    cls	
    :loop
        %SendKeys% "{ENTER}"
        
    goto :loop

  @EnD

##.vbs + .bat
Test 4:


Code:
SendKeys "{ENTER}"

SendKeys "exit{ENTER}"
SendKeys "H"
SendKeys "exit H"

## .vbs
Test 5:


Code:
if (CodeSection = Batch) then

echo off

rem Use %SendKeys% to send keys to the keyboard buffer
set SendKeys= (CScript E:JScript) "%~F0"

rem Start the other program in the same Window
start "" /B cmd

%SendKeys% "echo off{ENTER}"

set /P "=Wait and send a command: " < NUL
ping -n 5 -w 1 127.0.0.1 > NUL
%SendKeys% "echo Hello, world!{ENTER}"

set /P "=Wait and send an Up Arrow key: [" < NUL
ping -n 5 -w 1 127.0.0.1 > NUL
%SendKeys% "{UP}"

set /P "=] Wait and send an Enter key:" < NUL
ping -n 5 -w 1 127.0.0.1 > NUL
%SendKeys% "{ENTER}"

%SendKeys% "exit{ENTER}"

goto :EOF

## .vbs

Test 6:


Code:
Dim ReturnValue, I 
ReturnValue = Shell("CALC.EXE", 1) 
AppActivate ReturnValue    
For I = 1 To 100    
SendKeys I &; "{+}", True   
Next I   
SendKeys "=", True    
SendKeys "%{F4}", True    

## .vbs+.bat
## ^tried . file extension

And none of 'em got through. Old bird's a piece of crap, I'm sick and tired of this. Save me, someone from dying before I finish.

Thank you


My System SpecsSystem Spec
.
07 Jul 2017   #2
samuria

win 8 32 bit
 
 

You can use the free autoit this has lots of built in functions but it also has a macro recorder that can record keystroke and mouse and it writes the code for you https://www.autoitscript.com/site/autoit/
My System SpecsSystem Spec
Reply

 'SendKeys' automating wannabe with lack of reliable info




Thread Tools




Similar help and support threads
Thread Forum
Automating a Word Document Index
Hi Everyone, I'd be very grateful if someone would let me know if it is possible to "automate" an index in a Word 2007 document please. By this I mean that any user, having selected a Title or Subject in the Index, can somehow click the adjacent page number, and be whisked away to that page...
Microsoft Office
Automating Disk Cleanup?
Has anyone been sussessulf in automating Disk Cleanup in Windows 7? Had it working nicely in XP before the upgrade but can't seem to get it working the way I'd like. TweakHound - How To Schedule Disk Cleanup To Run Automatically in Windows XP
General Discussion
Windows 7 Game Explorer lack of Icon Customization Lack
I am a very disatisfied new Windows 7 user. My problem specifically is related to the new Game Explorer for Windows 7. Windows 7 Game Explorer does not allow for Icon Customization. Not at all. I find this to be a horrendous problem. When trying to drag my game icons from the folders where the...
Gaming


Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 16:51.
Twitter Facebook Google+ Seven Forums iOS App Seven Forums Android App