Skyclaw Posted February 26, 2006 Share Posted February 26, 2006 (edited) I'm abit new here, so hello everyone I'm new to autoit aswell, so I'd like to know if there's any command that opens a file. I looked in the help file but I didn't find any answers.Would be glad to get help : )CiaoOh and I'm sorry if this have been posted before. Edited February 26, 2006 by Skyclaw Link to comment Share on other sites More sharing options...
greenmachine Posted February 26, 2006 Share Posted February 26, 2006 What did you look for in the helpfile? Did you use the search function in the helpfile? There are definitely functions to open files, you just must not have been looking for the right thing. The function you're looking for is FileOpen. Link to comment Share on other sites More sharing options...
Skyclaw Posted February 26, 2006 Author Share Posted February 26, 2006 What did you look for in the helpfile? Did you use the search function in the helpfile?There are definitely functions to open files, you just must not have been looking for the right thing.The function you're looking for is FileOpen.I found FileOpen but what i could read it said "Opens a text file for reading or writing." I dont want to open a text file, I want to open a .exe file. Thanks for the fast answer btwCiao Link to comment Share on other sites More sharing options...
greenmachine Posted February 26, 2006 Share Posted February 26, 2006 Look at Run and RunWait. Link to comment Share on other sites More sharing options...
Skyclaw Posted February 26, 2006 Author Share Posted February 26, 2006 Look at Run and RunWait.Ah thanks <3 Link to comment Share on other sites More sharing options...
Skyclaw Posted February 26, 2006 Author Share Posted February 26, 2006 (edited) One more quick question, is there someway to use Mouse 5 button in Send? Edited February 26, 2006 by Skyclaw Link to comment Share on other sites More sharing options...
greenmachine Posted February 26, 2006 Share Posted February 26, 2006 Mouse 5 button? My mouse only has 3 buttons, so I'm not sure. Link to comment Share on other sites More sharing options...
Skyclaw Posted February 26, 2006 Author Share Posted February 26, 2006 Mouse 5 button? My mouse only has 3 buttons, so I'm not sure.I got a http://www.logitech.com/lang/images/0/4778.jpg . The buttons on the left is mouse 4 and mouse 5 (Mouse 4 down and Mouse 5 up). Link to comment Share on other sites More sharing options...
greenmachine Posted February 26, 2006 Share Posted February 26, 2006 Wow, that's a nice mouse. I just have a standard one.... Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted February 26, 2006 Moderators Share Posted February 26, 2006 Dayum... looks like it can drive itself to where ever you need to do... the Knight Industries Two Thousand (for those that are at least as old as me) of the mouse world!! Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Skyclaw Posted February 26, 2006 Author Share Posted February 26, 2006 (edited) Wow, that's a nice mouse. I just have a standard one....8)well... you dont know if their is anyway to use Mouse 5 in Send right? Edited February 26, 2006 by Skyclaw Link to comment Share on other sites More sharing options...
greenmachine Posted February 26, 2006 Share Posted February 26, 2006 I'm working on it... I looked up some stuff on msdn.microsoft.com, and found some things, but not exactly what you're looking for. The following table shows the symbolic constant names, hexadecimal values, and mouse or keyboard equivalents for the virtual-key codes used by the system. The codes are listed in numeric order. Constants VK_LBUTTON (01) Left mouse button VK_RBUTTON (02) Right mouse button VK_CANCEL (03) Control-break processing VK_MBUTTON (04) Middle mouse button (three-button mouse) VK_XBUTTON1 (05) Windows 2000/XP: X1 mouse button VK_XBUTTON2 (06) Windows 2000/XP: X2 mouse button - (07) Undefined VK_BACK (08) BACKSPACE key VK_TAB (09) TAB key ....That's a table of virtual key codes, of which primary, secondary, and mousewheel are a part (and I'm guess mouse x1 and x2 are your fourth and fifth buttons...?). So, I want you to try this: #include <misc.au3> HotKeySet ("{ESC}", "quitme") While 1 For $i = 1 To 255 If _IsPressed (Hex ($i)) Then MsgBox (0, "pressed", $i & @CRLF & Hex ($i, 2)) EndIf Next Sleep (100) WEnd Func quitme() Exit EndFunc You need beta for that. But once you can test it, click each of the buttons and tell me what (if anything) shows up in the msgbox when you click them. Link to comment Share on other sites More sharing options...
herewasplato Posted February 26, 2006 Share Posted February 26, 2006 (edited) Skyclaw,Read thru these:http://www.autoitscript.com/forum/index.ph...ghlite=%2BmouseI don't think that there is a native function for that at this time...greenmachine,Great code... Edited February 26, 2006 by herewasplato [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
greenmachine Posted February 26, 2006 Share Posted February 26, 2006 greenmachine,Great code...Hmm, it's hard to tell if that's a compliment or a sarcastic statement... it was something I threw together a while back because I needed to test something (or give it to someone else to test something). It gets the job done, but (as Larry said when I posted it) it's not the most efficient way. Link to comment Share on other sites More sharing options...
Skyclaw Posted February 26, 2006 Author Share Posted February 26, 2006 #include <misc.au3> HotKeySet ("{ESC}", "quitme") While 1 For $i = 1 To 255 If _IsPressed (Hex ($i)) Then MsgBox (0, "pressed", $i & @CRLF & Hex ($i, 2)) EndIf Next Sleep (100) WEnd Func quitme() Exit EndFunc Sorry, I'm abit newb on autoit but what is supposed to happen when using this script? Skyclaw, Read thru these: http://www.autoitscript.com/forum/index.ph...ghlite=%2Bmouse I don't think that there is a native function for that at this time... greenmachine, Great code... Dont seems like it Link to comment Share on other sites More sharing options...
greenmachine Posted February 26, 2006 Share Posted February 26, 2006 Like the function says, it tests which keys are pressed. _IsPressed is a beta function that takes in a hex value of a key (such as those found in the quote from msdn), checks the function GetAsyncKeyState in the dll user32.dll to see whether the given key is being pressed (1) or not (0). If it is pressed, the msgbox will display which number $i was on, and the hex value of $i. This helps for testing purposes (among other things). Press ESC to exit the script. Link to comment Share on other sites More sharing options...
nfwu Posted February 26, 2006 Share Posted February 26, 2006 mabbe you should explain clearer, greenmachine. The code which he provided does this: When you press a button (keyboard or mouse or whatever), it pops up a message box containing the keycode of that button. Useful for finding the keycode of a button then putting it into Send or _IsPressed or Whatever. TwitterOut of date stuff:Scripts: Sudoku Solver | Webserver | 3D library (Pure AutoIt) | Wood's GadgetsUDFs: _WoodUniqueID() | _DialogEditIni() | _Console*() | _GetIPConfigData() | _URLEncode/Decode() Link to comment Share on other sites More sharing options...
greenmachine Posted February 26, 2006 Share Posted February 26, 2006 It was plenty clear, just not simple enough. You can't exactly put this code into a Send function either. It's going to take much more work than that, since it's not built-in. Link to comment Share on other sites More sharing options...
herewasplato Posted February 26, 2006 Share Posted February 26, 2006 ...compliment or a sarcastic statement...It was/is a compliment.I knew that this idea was posted to the idea lab.I created a search link for the OP.I posted it... then I saw your post ahead of mine.I edited my post to put less emphasis on my link as it would not lead the OP to any code better than the route that you are taking... at least not that I saw. (and I know that the idea lab is not the ideal place to look for code - but I remembered some work arounds in those posts) [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
greenmachine Posted February 26, 2006 Share Posted February 26, 2006 It was/is a compliment.I knew that this idea was posted to the idea lab.I created a search link for the OP.I posted it... then I saw your post ahead of mine.I edited my post to put less emphasis on my link as it would not lead the OP to any code better than the route that you are taking... at least not that I saw. (and I know that the idea lab is not the ideal place to look for code - but I remembered some work arounds in those posts)Ok, I see. Thanks for the compliment (in that case). It's just too hard to tell with text.... 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