trpooler Posted August 8, 2015 Posted August 8, 2015 I'm trying to just make a simple script where when I press the tab key it also sends the key press 1. This would just run once per tab press.
Moderators Melba23 Posted August 8, 2015 Moderators Posted August 8, 2015 trpooler,Welcome to the AutoIt forums.And what have you tried for yourself so far that has not worked? Think of the old saying: "Give a man a fish, you feed him for a day; give a man a net and you feed him forever". We try to be net makers and repairers, not fishmongers. So take a look at HotKeySet & Send in the Help file and see if you can come up with something. If you run into problems, then post your code (see here how to do it) and we will see what we can do to get it running.M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
trpooler Posted August 8, 2015 Author Posted August 8, 2015 I've read a lot of the help files but having almost no script experience some of the context went right over my head. I've been at this for a few hours or so but this is what I left with. HotKeySet("{tab}", "Send"){Func Send()Send(1)ExitEndFunc}
Moderators Melba23 Posted August 8, 2015 Moderators Posted August 8, 2015 trpooler,Close but no cigar. Take a look here:HotKeySet("{TAB}", "_Send") HotKeySet("{ESC}", "_Exit") ; You need some way to end While 1 Sleep(10) ; This infinite loop keeps the script alive while waiting for the HotKey to be pressed WEnd Func _Send() ; This is your function - you cannot use the same name as a built-in function so add an underscore Send(1) EndFunc Func _Exit() ; Same thing here Exit EndFuncPlease ask if you have any questions.M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
trpooler Posted August 8, 2015 Author Posted August 8, 2015 Thank you for your help so far.When I try to run that script it says that line 6 WEnd does not contain a recognized function
water Posted August 8, 2015 Posted August 8, 2015 No problem here. Did you modify the script? My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
trpooler Posted August 8, 2015 Author Posted August 8, 2015 No I did not modify at all. I took a screenshot showing the error when I try to run it, you can see the script as well.
trancexx Posted August 8, 2015 Posted August 8, 2015 Usually AutoIt scripts have .au3 extensions. That's how correct association with the (correct) interpreter is made.Make sure your code is run by AutoIt interpreter. ♡♡♡ . eMyvnE
computergroove Posted August 8, 2015 Posted August 8, 2015 Try to add quotes:Send("1") Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html
Moderators Melba23 Posted August 8, 2015 Moderators Posted August 8, 2015 trpooler,I see an .AHK (AutoHotKey) extension in that error message - here we help with scripts using the .AU3 (AutoIt) extension. Are you sure you are posting in the correct forum?M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
water Posted August 8, 2015 Posted August 8, 2015 You are mixing AHK and AutoIt. You can't run Autoit code with the AHK interpreter. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
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