I am having a problem with SendKeepActive where it does not properly send keystrokes. The problem is with GIMP: when the program loads, the script attempts to create a new image file with ctrl+n:
SendKeepActive("GNU Image","")
Send("{CTRLDOWN}n{CTRLUP}")
I can observe that when these lines execute, the Gimp window blinks (focused state, non-focused state, focused state) and I do not see a new image window.
When GIMP is started, the focus is on the GNU Image ... (main GIMP window), but the mouse is hovering over the GIMP tools window and is displaying the text tooltip.
If I go over these steps by hand, the new image window does show up.
If I also comment out the SendKeepActive line, the script also works correctly.
If I change Send("{CTRLDOWN}n{CTRLUP}") to Send("^n"), the script also works correctly.
If I move the mouse away from the tools window when those lines execute, the script also works correctly.
My SendKeyDelay is set to 100.
Does anyone know what the problem is?
SendKeepActive does not properly send keystrokes?
Started by
olegsomphane
, Feb 03 2012 01:27 AM
3 replies to this topic
#1
Posted 03 February 2012 - 01:27 AM
#2
Posted 03 February 2012 - 04:57 AM
I fail with Send() when I type latin letters, but it works good when I use Cyrillic. So I think it depends on the Windows language or keyboard set
#3
Posted 25 April 2012 - 08:47 PM
i know this is dated, but if removing SendKeepActive() allows your Send() to work, then the window that you are declaring in SendKeepActive() may not be correct. Many times window titles will change based on what file is accessible (i.e. "GNU Image - C:UsersuserDesktopimage.pst").
Put in the beginning of your code to do a sort of String-In-String search for the window title, basically it does a partial match of the title. So as long as "GNU Image" exists somewhere in the window title, it will be targeted. Just make sure there are no other windows that will be open at the same time with the same title substring.
Put
“Hello, ladies, look at your man, now back to me, now back at your man, now back to me. Sadly, he isn’t me, but if he stopped using ladies scented body wash and switched to Old Spice, he could smell like he’s me. Look down, back up, where are you? You’re on a boat with the man your man could smell like. What’s in your hand, back at me. I have it, it’s an oyster with two tickets to that thing you love. Look again, the tickets are now diamonds. Anything is possible when your man smells like Old Spice and not a lady. I’m on a horse.”
#4
Posted 26 April 2012 - 12:11 PM
I would suggest trying either ControlSend or WinMenuSelectItem, rather than Send, for more stable results. Then you don't have to worry about SendKeepActive.
J.I spent 10 minutes reviewing code and thinking "What kind of drugs is this guy on?" before realizing it was something I wrote.My Scripts:Include Source with Compiled Script, Disk Maintenance for Windows XP, "Deal-A-Day" Sites, SCCM 2007 Front End, Windows Firewall UDF
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users





