Sign in to follow this  
Followers 0
kcvinu

How to start my script with a hotkey

8 posts in this topic

#1 ·  Posted (edited)

Hi there,

I have made a script to toggle my two windows. It is working. But i need the functionality of a hot key to this script. Tell me what should i do fo this

Write a HotKeySet function inside my script

                   

                       OR

Complie my script as it is and make shortcut of that exe and set a hotkey for that exe to run.

Edited by kcvinu

My Contributions

UDF Link Viewer   --- A tool to visit the links of some most important UDFs 

 Includer_2  ----- A tool to type the #include statement automatically 

 Digits To Date  ----- date from 3 integer values

PrintList ----- prints arrays into console for testing.

 Alert  ------ An alternative for MsgBox 

 MousePosition ------- A simple tooltip display of mouse position

GRM Helper -------- A littile tool to help writing code with GUIRegisterMsg function

Access_UDF  -------- An UDF for working with access database files. (.*accdb only)

 

Share this post


Link to post
Share on other sites



To start the Exe I would do the latter.

1 person likes this

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

I would do the first, because I have found that if I do the latter, I usually delete the shortcut along with all the other junk on my desktop.

1 person likes this

Share this post


Link to post
Share on other sites

Personally, I've had less than satisfactory experience with Hotkeys, so I'd do neither, and would just use a Quick Launch facility or first section of the start menu ... or a floating toolbar ... perhaps accessed through the Tray.

In the end, it may be down to your version of Windows.

So there you have it, three recommendations ..... now which one will you choose?

1 person likes this

AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Share this post


Link to post
Share on other sites

kcvinu,

I have >already told you once - post general support questions in "General Help and Support", not "Dev Chat". Please do not do it again. :naughty:

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

kcvinu,

I have now merged the 2 threads you have started on this subject. Please stick to just the one from now on. :naughty:

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

Hi there,

how to start a script itself with a hotkey ?. 

 

Post your script, and let us know which hotkey you want to use.

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

If the hotkey is created using AutoIt, clearly the script has to be running for it to work. Here's an example program which waits until the hotkey F2 is pressed.

;

#include <MsgBoxConstants.au3>

Global $g_Flag = False

HotKeySet("{F1}", "Quit")
HotKeySet("{F2}", "Resume")

While 1 ; Infinite loop
    Sleep(20) ; Prevents the CPU from overheating
    If $g_Flag Then ExitLoop
WEnd

Func Resume()
    $g_Flag = True
EndFunc

Func Quit()
    Exit
EndFunc

; The program starts here
MsgBox($MB_OK, "Test Script", "Hello World")

;

You could create a similar script to activate other programs. Look at ShellExecute() in the help file.

Edited by czardas
1 person likes this

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0