Jump to content

shortcut woes


t0ddie
 Share

Recommended Posts

in a shortcut property, i have it hotkeyed for control-alt-1

i never have a problem opening the shortcut by double clicking it.

the shortcut will open most of the time when i send("^!1") in a script

but sometimes it will not open right away, it takes about 60 seconds.

after this occurs (quite often) the shortcut hot key will not work at all.

not even why i type control-alt-1 on my keyboard without using send.

i change the hotkey and it works again, but then i have to change it again because the same problems are continuing.

so heres pretty much the very basic code im using

send("^!1")
do
sleep(100)
until winexists("11")

my script just freezes in that loop alot of time and other times it does not. its very annoying.

i would use winwaitactive with a timer and then try opening the shortcut again..... but theres still the issue of the hot key no longer working for the shortcut after it does the "LAG" thing.

is it my code? my computer? lol.... im stuck

when it lags i try to close script but the computer is frozen.

i use task manager and end autoit then the computer is lagged for about 60 seconds and you still see the autoit icon in the tray

and when the computer starts working again the icon dissappears and my shortcut finally starts.

but then the hotkey dont work for the shortcut anymore

Edited by t0ddie

Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Link to comment
Share on other sites

So even after you kill the process and restart your script the hotikey still no longer functions? :P

I'd have to see all of your code to know whats going on. The only time I've seen this is when it's stuck in a loop. Is you Anti-virus software scanning you script? Take a peek at your task manager when you use your hot-key to see if some process is hogging the CPU.

Link to comment
Share on other sites

..but sometimes it will not open right away...

This sometimes happens to me when I manually use an OS shortcut key. I have my clock display the seconds and over the years, I've gotten in the habit of glancing at those seconds when I want to see if the system has frozen. Using the system's shortcut keys is one thing that can stop the seconds from updating to the display. When one of my systems get into that state, I cannot do anything until it decides to launch the app that I asked for... once the app starts, the seconds on the clock update and Im able to do other things. So, you are not alone but I do not think that it has ever taken 60 seconds, more like 15 to 20 for me.

[size="1"][font="Arial"].[u].[/u][/font][/size]

Link to comment
Share on other sites

So even after you kill the process and restart your script the hotikey still no longer functions? :P

actually that was just during lag after more testing... so i guess i dont have to switch them

but this is annoying... like when i click the shortcut there is NEVER a problem its just when using the hot key.

i WISH that you could run .lnk with autoit

is there any other solution for running a shortcut besides using a hotkey (shortcut properties) or .. rebooting the system (registry can start a .lnk)?

ALSO... cpu is running low %

Edited by t0ddie

Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Link to comment
Share on other sites

actually that was just during lag after more testing... so i guess i dont have to switch them

but this is annoying... like when i click the shortcut there is NEVER a problem its just when using the hot key.

i WISH that you could run .lnk with autoit

is there any other solution for running a shortcut besides using a hotkey (shortcut properties) or .. rebooting the system (registry can start a .lnk)?

ALSO... cpu is running low %

Messy but it works

#include <Process.au3>
$details = FileGetShortcut(@DesktopDir & "\winzip.lnk")
$exec = FileGetShortName($details[0])
run($exec)


Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Link to comment
Share on other sites

I also found this to work:

Run(@COMSPEC & " /c Start C:\testing\Notepad.lnk")

[u]Helpful tips:[/u]If you want better answers to your questions, take the time to reproduce your issue in a small "stand alone" example script whenever possible. Also, make sure you tell us 1) what you tried, 2) what you expected to happen, and 3) what happened instead.[u]Useful links:[/u]BrettF's update to LxP's "How to AutoIt" pdfValuater's Autoit 1-2-3 Download page for the latest versions of Autoit and SciTE[quote]<glyph> For example - if you came in here asking "how do I use a jackhammer" we might ask "why do you need to use a jackhammer"<glyph> If the answer to the latter question is "to knock my grandmother's head off to let out the evil spirits that gave her cancer", then maybe the problem is actually unrelated to jackhammers[/quote]

Link to comment
Share on other sites

I also found this to work:

Run(@COMSPEC & " /c Start C:\testing\Notepad.lnk")
i think this would be best because i run the shortcut with arguments

Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Link to comment
Share on other sites

well.. i have the shortcut 1.lnk in my script directory

Run(@COMSPEC & " /c Start " & @ScriptDir & "/1.lnk")

error says windows cannot find 'C:\Documents'

Edited by t0ddie

Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Link to comment
Share on other sites

Do this for testing:

$var = @COMSPEC & " /c Start " & @ScriptDir & "/1.lnk"
MsgBox(0, "Value", $var)
; Temporarily comment out your execute command
; Run(@COMSPEC & " /c Start " & @ScriptDir & "/1.lnk")

I bet you will find something funny in the formatting. When you get it to look good, you can just do a Run($var) and you should be good to go.

Edited by SpookMeister

[u]Helpful tips:[/u]If you want better answers to your questions, take the time to reproduce your issue in a small "stand alone" example script whenever possible. Also, make sure you tell us 1) what you tried, 2) what you expected to happen, and 3) what happened instead.[u]Useful links:[/u]BrettF's update to LxP's "How to AutoIt" pdfValuater's Autoit 1-2-3 Download page for the latest versions of Autoit and SciTE[quote]<glyph> For example - if you came in here asking "how do I use a jackhammer" we might ask "why do you need to use a jackhammer"<glyph> If the answer to the latter question is "to knock my grandmother's head off to let out the evil spirits that gave her cancer", then maybe the problem is actually unrelated to jackhammers[/quote]

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