square65 Posted February 11, 2015 Posted February 11, 2015 I'm new and therefore not yet knowledgeable enough to know how to search for answers to my questions. I did try for several minute but found absolutely nothing even close to my question. I open up the SciTE-Lite editor and write some code. I can test it with Tools->Go (F5) How do I set a hotkey for the macro..? And what do I need open to execute it? All I've been able to find are ways to dynamically set the hotkey in code and running the script file manually to execute the script once. Thanks. I'm sure my confusion is due to having absolutely no idea how this works.
Moderators Melba23 Posted February 11, 2015 Moderators Posted February 11, 2015 square65,Welcome to the AutoIt forums. You will need to have a script running permanently to recognise the HotKey, you cannot just start it from scratch. And then it is up to you whether you use the same script to do whatever it is you want to happen when the HotKey is pressed or whether you launch another separate script. Perhaps if you gave us a bit more information on what exactly you want to do we could offer you some more focused advice. 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
square65 Posted February 11, 2015 Author Posted February 11, 2015 I'm creating a script that executes some series of actions in windows when a hotkey is pressed. Something like clicking, typing some text, etc. So would I do something like: While 1WEnd And have a function that does what I want my macro do. And have a HotKeySet up top that binds that function to my desired hotkey?
Moderators Melba23 Posted February 11, 2015 Moderators Posted February 11, 2015 square65,Then all you need to do is to set the HotKey to run your function while using a loop to keep the script alive. Something like this:#include <MsgBoxConstants.au3> ; HotKey to exit - Escape HotKeySet("{ESC}", "_Exit") ; HotKey to run the function - Ctrl-H HotKeySet("^h", "_My_Func") ; Keep script alive While 1 Sleep(10) ; Important to give the CPU some breathing space WEnd ; User function Func _My_Func() ; A simple MsgBox as an example MsgBox($MB_SYSTEMMODAL, "Example", "Called by HotKey") EndFunc ; Exit funtion Func _Exit() Exit EndFuncAll clear? 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
square65 Posted February 11, 2015 Author Posted February 11, 2015 Yep that's what I wrote in my second post hehe Thanks for your help.
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