ToyBoi Posted July 11, 2008 Posted July 11, 2008 This is going to sound stupid, but i'm having a problem having autoit to send the enter key. Send("{ENTER}") Exit I run this, but it keeps pressing enter, i want it to only do it once. did i do something wrong?
AlmarM Posted July 11, 2008 Posted July 11, 2008 Can you show us the full code? -AlmarM- Minesweeper A minesweeper game created in autoit, source available. _Mouse_UDF An UDF for registering functions to mouse events, made in pure autoit. 2D Hitbox Editor A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes.
AdmiralAlkex Posted July 11, 2008 Posted July 11, 2008 That was only 1 enter. There must be something you are not showing us if it's repeating. .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface
ToyBoi Posted July 11, 2008 Author Posted July 11, 2008 this is my code, i just added the notepad line to prove that it in fact does press enter more than once,when i comment out the sleep function, it opened 2x notepadswhen i uncomment it, it opened 3x notepads.if i comment out both, i get the busy cursor and hour glass cursor conseqetively until i manually click somewhere
7h331337 Posted July 11, 2008 Posted July 11, 2008 (edited) if you want to see how many times enter is sent then uses something like this CODE run("notepad.exe") WinWaitActive("Untitled -") send("{enter}") Edited July 11, 2008 by 7h331337
ToyBoi Posted July 11, 2008 Author Posted July 11, 2008 when i use your code, it only presses enter once, but when i use mine, it opens more than one notepad? do you think it could a problem with my computer? or should i save it as an exe first? right now it's au3
AdmiralAlkex Posted July 11, 2008 Posted July 11, 2008 Perhaps you aren't releasing the F5 button fast enough so the script can run multiple times before you release the button?? (pure guess, I don't know if that's even possible) Try running your script by pressing "Tools" and then "Go". .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface
ToyBoi Posted July 11, 2008 Author Posted July 11, 2008 well actually i just activate it by opening the actual au3 file the reason why im doing this is when my macro from excel imports txt files, it asks for a confirmation and after i asked many vba experts, i concluded that there is no way to get around that. so i want vba to call autoit to simulate an enter key, but if it keeps pressing enter non stop then it will mess up my macro.
ProgAndy Posted July 11, 2008 Posted July 11, 2008 (edited) AutoIt presses only once, if you write Send"{ENTER}").well actually i just activate it by opening the actual au3 fileWell, then the Script-Icon in Explorer is still activated and ... with "enter" it is started again... and again until the Explorer looses focus muttleythe reason why im doing this is when my macro from excel imports txt files, it asks for a confirmation and after i asked many vba experts, i concluded that there is no way to get around that.so i want vba to call autoit to simulate an enter key, but if it keeps pressing enter non stop then it will mess up my macro.It works, but you have to make a WinWaitactive and possibly you can use ControlClick instead of sending ENter. Edited July 11, 2008 by ProgAndy *GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes
ToyBoi Posted July 11, 2008 Author Posted July 11, 2008 AutoIt presses only once, if you write Send"{ENTER}").Well, then the Script-Icon in Explorer is still activated and ... with "enter" it is started again... and again until the Explorer looses focus It works, but you have to make a WinWaitactive and possibly you can use ControlClick instead of sending ENter.omg you are right!! i feel so stupid, of course it's going to do that forever, well i said it was a stupid question muttley thanks for the help.
ToyBoi Posted July 11, 2008 Author Posted July 11, 2008 quick last question, whats the vba code for me to call an autoit file, say if it's called "click.au3" and it is going to be in the same folder as my macro i have a variable called importpath which is importpath = ActiveWorkbook.path
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now