Sign in to follow this  
Followers 0
satanttin

[SOLVED]Need help with a simple shortcut program.

20 posts in this topic

#1 ·  Posted (edited)

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

Share this post


Link to post
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 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

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.

Share this post


Link to post
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 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

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?

Share this post


Link to post
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 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

OMG O.o when i make it {TAB}+{PAUSE} it still opens a chrome when i press Tab+Pauze O.o

m'kay this almost scares me:O i have no function at pauze and still does it:S i bet someone cursed me:(

Share this post


Link to post
Share on other sites

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

this works just for the lshift though now gotta look how i do tab+"key"

Share this post


Link to post
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 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
v3.3.8.1 isn't that a good one?

Share this post


Link to post
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 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

yeah dunno:O kinda strange can it be that i need to include something in my script or?

Share this post


Link to post
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 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

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?

Share this post


Link to post
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.

 

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

#17 ·  Posted (edited)

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 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

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.

 

Share this post


Link to post
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 ^^

Share this post


Link to post
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 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

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