grindy Posted November 21, 2012 Share Posted November 21, 2012 (edited) I'm NOT a great programmer by any stretch of the imagination, I'm not even a good one - but I do try... A friend recommended AutoIt to me as a way to create a small .exe that I can call from another program, but I can't seem to get (what I think should be really trivial) it to work, and I think a good part of it is the way the help file for AutoIt is written. Let me give you a simple example: The description for the Send command shows: Send ( "keys" [, flag] )**Notice the spaces between the parenthesis and brackets and the value itself.** However, throughout the Help file, I see examples such as: Send("{DEL 4}")**Again, notice the lack of spaces between the parenthesis and brackets and the value itself.** I've done enough programming to think that these spaces DO matter, and need to know from you: A - Do they matter? B - If they do, then which Help file example is correct? Oh, and if any of you would care to help me, here's what I want to do with AutoIt: I want to compile a small .exe that will do the following: I want the window of the program that will be the recipient of the F4 that I'm going to be sending to it, to have the focus (if it doesn't have it already), and I want to keep it active for the F4 key I'm sending to it. That's it! But so far, I'm failing miserably.... I know (well I think I know) that to do this I'll be using: WinActivate, SendKeepActive, and Send in order to achieve this. If there's anything else any of you think I might need to achieve what I mentioned, feel free to comment... And, if any of you wants to write (and share here) this little snippet of a code, by all means help yourself... Thx for listening, and thx in advance for any help you can offer... Edited November 21, 2012 by grindy Link to comment Share on other sites More sharing options...
somdcomputerguy Posted November 21, 2012 Share Posted November 21, 2012 B - They do, sometimes, and both examples are correct. The first quoted example shows the correct syntax for the function, and the second shows the actual usage of that function. In this case, the space DOES matter, as DEL4 is different than DEL 4. If there were more than one flag, or parameter, passed to a function, a space before or after the comma separating the parameters is not needed, but could be used for aesthetic purposes (ie, the code would be sometimes easier to read). - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
water Posted November 21, 2012 Share Posted November 21, 2012 Only the spaces within a string matter.Send("{Del 4}",1)andSend ( "{Del 4}" , 1 )are equivalent. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
Nu11Fish Posted November 21, 2012 Share Posted November 21, 2012 So you want to make a window and have it recieve a key (F4) you press? Because using Send would be to actually send the key FROM the program... Link to comment Share on other sites More sharing options...
water Posted November 21, 2012 Share Posted November 21, 2012 What do you mean by "receive a key"? The window should act on a key pressed by the user? When the window is active (has focus) the user input is received by the window. You would like to act on the specific user input even when the window is inactive? Can you please elaborate on what you want to do? My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
JohnOne Posted November 21, 2012 Share Posted November 21, 2012 The help file is one of the best I have ever seen for anything. Your post "leaves a lot to be desired" incidentally. Post your code. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted November 21, 2012 Moderators Share Posted November 21, 2012 I agree with JohnOne, you're not providing a lot of information for us to try to assist. What is the name of the application you're trying to manipulate, and what does the window look like? There may be a much easier way to accomplish what you're trying to do. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
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