Jump to content

[SOLVED]Need help with a simple shortcut program.


Recommended Posts

Best Autoiters,

I want to make a simple program so i can easily open programs like internet excel and that kind.

just run into a problem when i use a shortcut to open chrome.exe it doesn't do a thing and when i close the script using the pauze button it's opening the chrome.exe which is weird O.o

here is the code:

HotKeySet("{PAUSE}", "StopScript")
HotKeySet("{TAB}+{F1}", "google")

While 1

WEnd


Func StopScript()
Exit
EndFunc

Func google()
run ("chrome.exe")
EndFunc

hope someone can help me:)

Greetz Satanttin

Edited by satanttin
Link to comment
Share on other sites

Why don't you assign a shortcut to the application itself? We use Ctrl+Alt+I (Internet Explorer), Ctrl+Alt+X (Excel) etc.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.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 (NEW 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

 

Link to comment
Share on other sites

Why don't you assign a shortcut to the application itself? We use Ctrl+Alt+I (Internet Explorer), Ctrl+Alt+X (Excel) etc.

mainly because i want to learn more about autoit codes. and because it's easlier to do when you are on another computer which is alot in my case.
Link to comment
Share on other sites

This works for me. I removed the "+" from the HotKeySet and replaced Run with ShellExecute because you have to specify thw whole path when using Run.

HotKeySet("{PAUSE}", "StopScript")
HotKeySet("{TAB}{F1}", "google")

While 1

WEnd


Func StopScript()
    Exit
EndFunc   ;==>StopScript

Func google()
    ShellExecute("chrome.exe")
EndFunc   ;==>google

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.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 (NEW 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

 

Link to comment
Share on other sites

This works for me. I removed the "+" from the HotKeySet and replaced Run with ShellExecute because you have to specify thw whole path when using Run.

HotKeySet("{PAUSE}", "StopScript")
HotKeySet("{TAB}{F1}", "google")

While 1

WEnd


Func StopScript()
Exit
EndFunc ;==>StopScript

Func google()
ShellExecute("chrome.exe")
EndFunc ;==>google

weird still doesn't run when i press lshit+F1 and still doesn't exit on pauze and when pauze it still opens the chrome:( weird O.o but thanks for the response:)

maybe it's because i need to include something or?

Link to comment
Share on other sites

You should press TAB+F1 (that's what is coded in the HotKeySet statement).

Insert

Sleep(100)
into your While/WEnd loop so the script doesn#t eat up all CPU cycles.

Where on your keyboard is the Pause key? Maybe you need to press Shift+Pause or Alt+Pause.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.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 (NEW 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

 

Link to comment
Share on other sites

All the key combinations you describe work fine for me. Which AutoIt version do you run?

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.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 (NEW 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

 

Link to comment
Share on other sites

That's fine.

I just wonder why it works here and it doesn't for you.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.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 (NEW 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

 

Link to comment
Share on other sites

Nothing needs to be included. It's all part of AutoIt.

I'm not sure +{Tab}{F1} is a good combination. Chrome is started as soon as I press +{Tab}. I would suggest to use +{F1} only.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.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 (NEW 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

 

Link to comment
Share on other sites

Nothing needs to be included. It's all part of AutoIt.

I'm not sure +{Tab}{F1} is a good combination. Chrome is started as soon as I press +{Tab}. I would suggest to use +{F1} only.

when i use +{F!} it works just i want the schortcut to be TAB+F1 or is't that possible at all?
Link to comment
Share on other sites

think chrome is started as soon as tab is pressed and F1 is ignored (at least on my comp XP at the moment)

due to tab isnt blocked with F1 combination as result im getting 1000 windows if you hold it 2 long

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
There are those that believe that the perfect heist lies in the preparation.
Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.

 
Link to comment
Share on other sites

think chrome is started as soon as tab is pressed and F1 is ignored (at least on my comp XP at the moment)

due to tab isnt blocked with F1 combination as result im getting 1000 windows if you hold it 2 long

thanks i can test a few other keys in combination with the F keys and well maybe it's true TAB+F keys doesn't work.
Link to comment
Share on other sites

Same here. I think the docu describes it here:

The following hotkeys cannot be set: "any combos of two or more "base keys" such as '{F1}{F2}'"

Edited by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.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 (NEW 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

 

Link to comment
Share on other sites

shudnt b

HotKeySet("{F1}{TAB}", "google")?

instead

HotKeySet("{TAB}{F1}", "google")

itl fix the tab starting but for multiplye starting no sollution if you dont use ispressed in combination with your Func google()

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
There are those that believe that the perfect heist lies in the preparation.
Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.

 
Link to comment
Share on other sites

shudnt b

HotKeySet("{F1}{TAB}", "google")?

instead

HotKeySet("{TAB}{F1}", "google")

itl fix the tab starting but for multiplye starting no sollution if you dont use ispressed in combination with your Func google()

if i do that it will open it with every tab i press xD ahwell i just use em with numpad keys:P way easier anyways:O

thanks for the replys^^ and well this post can be closed because it's solved ^^

Link to comment
Share on other sites

To close it you can select your first post, click on "Edit" then click "Use full Editor" and change the thread title by prepending "[solved]" or something similar.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.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 (NEW 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

 

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...