AutoHotkey Community

It is currently May 26th, 2012, 9:08 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 14 posts ] 
Author Message
PostPosted: July 2nd, 2009, 6:16 am 
:cry: I am new to autohotkey. when i open a website, such as suggestedin the tutorial, Run www.google.com it takes 5 or 6 seconds, the same just for opening a folder, for example, Run, C:\My Recordings. The only command i have tried so far that is quick is MsgBox. This is on XP home. If anyone knows how to make it run quickly, i would love to know. thanks, edward


Report this post
Top
  
Reply with quote  
PostPosted: July 2nd, 2009, 7:09 am 
Offline
User avatar

Joined: March 19th, 2008, 12:43 am
Posts: 5480
Location: the tunnel(?=light)
All AHK does when Run www.google.com is executed is call your default web browser to open the website; everthing else in terms of speed is dependent upon your PC and your web browser. The same also applies for Run, C:\My Recordings with an additional factor being the size of the folder being accessed. If you have any doubts here's a way to check how quickly the commands are being executed:

Code:
!x::
Start := A_TickCount
Run www.google.com
MsgBox % A_TickCount - Start "ms have passed."
return

!y::
Start := A_TickCount
Run C:\My Recordings
MsgBox % A_TickCount - Start "ms have passed."
return


Both of those will display a message box that shows the amount of milliseconds it took to process those commands. If you'd like you can let us know how many milliseconds each one took compared to how fast you estimate the whole task was completed in, but chances are the slowness is a result of the PC and/or web browser, which AHK doesn't have any control over in that regard. It can tell them to open, but not how fast.

_________________
Image
Try Quick Search for Autohotkey or see the tutorial for newbies.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 2nd, 2009, 9:13 am 
Offline

Joined: February 7th, 2009, 11:28 pm
Posts: 384
try running those commands a few times in a row to make sure the delay is not due to the initialization of your browsers. compare to how quickly they open if you use a regular shortcut.

check that your antivirus/antispyware or firewall isn't delaying ahk to scan it (whitelist autohotkey.exe and *.ahk).

use "SetBatchLines, -1" or "Process, Priority, High" at the beginning of the script, though these are more likely to matter only for larger scripts or when your system is under stress.

I see people debate the usefulness of "defragging" quite a bit, but I'm a proponent of it when done to optimize file arrangement rather than just straight defragmenting of files. I enable last access time stamps i.e. turn off (to 0) NtfsDisableLastAccessUpdate entries in registry (for ntfs only of course), and I use a good defragger to optimize my system. i.e. generally they move the files that are accessed frequently to the faster areas of the hard drive (outer edge), but I also like to move frequently used *.exe, *.dll, *.ahk, etc to the fast areas, and files I never need (*.zip, *.rar, *.iso, ...) to the inner (slower) areas.

_________________
Hardware: 1.8 GHz laptop with 4 GB ram, Windows XP/SP3
Software: Prevx, Privatefirewall, KeyScrambler.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 2nd, 2009, 9:56 am 
Quote:
and I use a good defragger to optimize my system
Which one (link) ?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: July 2nd, 2009, 10:58 am 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7502
Location: Australia
At least one other user has had this problem. I couldn't find the thread, but I think explicitly specifying the browser exe solved the problem. For instance:
Code:
; Ensure the path is correct before testing:
Run "%A_ProgramFiles%\Mozilla Firefox\firefox.exe" http://www.google.com
; Path usually isn't necessary for IE:
Run iexplore.exe http://www.google.com
sinkfaze wrote:
All AHK does when Run www.google.com is executed is call your default web browser to open the website;
In fact, it does even less: it passes the URL to ShellExecuteEx, and the shell (i.e. Windows Explorer) does the rest.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 2nd, 2009, 12:15 pm 
Offline

Joined: February 7th, 2009, 11:28 pm
Posts: 384
BoBo³ wrote:
Quote:
and I use a good defragger to optimize my system
Which one (link) ?


I've tried many, but currently I use Disktrix Ultimate Defrag because (a) it can run in safe mode (fewer active/locked processes = better defrags), and (b) it gives user more options to specify how system will be optimized than other defraggers I've tried. But (c) may be confusing to configure for the typical user who has not read the manual and isn't familiar with hard drive optimization concepts, and (d) not free.

link : http://www.disktrix.com/ultimatedefrag_home.htm

There's a free version, but it looks slightly older, and may not have a full boot time defrag feature: http://download.cnet.com/UltimateDefrag ... 82157.html

Another free one I like is Microsoft's (a la Sysinternals) ScanDefrag with JkDefrag algorithm chosen, PageDefrag added (also from MS a la Sysinternals), and last access time stamps enabled. However, it's slow so when I use it it choose the 'shut computer when done' option and leave it to defrag over night.
http://www.majorgeeks.com/download.php/ ... d5108.html
and http://majorgeeks.com/Pagedefrag_d603.html

I also run a Registry Defrag now and then (I think this covers the boot defrag issue). PageDefrag (previous link) works and I think all reg defraggers do exactly the same thing. I mostly use NTREGOPT for no particular reason - it came with ERUNT, which is another great free utility - it backs up reg hives and serves as a system restore replacement): http://majorgeeks.com/Erunt_d1267.html

_________________
Hardware: 1.8 GHz laptop with 4 GB ram, Windows XP/SP3
Software: Prevx, Privatefirewall, KeyScrambler.


Report this post
Top
 Profile  
Reply with quote  
PostPosted: July 2nd, 2009, 3:13 pm 
Lexicox, Thank you! Thank you! Thank you! I tried inserting the path as you suggested and the result: (using the timer MsgBox suggested by sinkfaze, for which I am also appreciative) the time to open google.com was reduced as follows: Before: 14656 ms. After: 94 ms.!!!!!! I had tried opening the browser repeatedly and the timing did not change. Even opening C:\My Recording took over 7 seconds (for example,7844 ms, 7656 ms, 7938 ms on three successive attempts. And, the size of the MyRecording file is only 252 mb). So, the path is the answer. I studied a little bit of VB (back in the day of VB 4.0), so boy am I going to enjoy AutoHotkey. This looks like a great forum. If I had not found a solution to this slow opening issue, I would not used this terrific program. I think I already said it, but I will say it again to make sure: Thank you, Lexicos!!!!! Edward in Seattle, Washington. :D :D :D


Report this post
Top
  
Reply with quote  
 Post subject: Thank you Lexikos!
PostPosted: July 2nd, 2009, 3:16 pm 
Thank you Lexikos! Sorry I so badly mispelled your name!!! Don't know what I was thinking, if anything


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: July 2nd, 2009, 3:41 pm 
Offline

Joined: October 21st, 2007, 4:32 am
Posts: 54
Quote:
Lexicox


I wont laugh, I promise.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 2nd, 2009, 4:39 pm 
Offline

Joined: September 16th, 2008, 7:53 pm
Posts: 77
Too late for me. I cracked up, already. LOL. (I'm soooo freakin' immature.)


Report this post
Top
 Profile  
Reply with quote  
PostPosted: July 3rd, 2009, 6:41 am 
Does anyone know why explorer is much slower to open c:\ than google, as below? I can click Start, My Computer and then C: much faster than AutoHotKey opens C: as per the second script below.

!x::
Start := A_TickCount
Run iexplore.exe http://www.google.com
MsgBox % A_TickCount - Start "ms have passed."
return

!y::
Start := A_TickCount
Run iexplore.exe C:\
MsgBox % A_TickCount - Start "ms have passed."
return


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: July 3rd, 2009, 6:50 am 
Code:
!y::
Start := A_TickCount
Run explorer.exe C:\
MsgBox % A_TickCount - Start "ms have passed."
return


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: July 3rd, 2009, 7:53 am 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7502
Location: Australia
Btw, you can also open an explorer window with a particular object selected:
Code:
Run explorer.exe /select,c:
This opens My Computer with C: selected.


Report this post
Top
 Profile  
Reply with quote  
PostPosted: July 3rd, 2009, 10:55 am 
Offline

Joined: February 7th, 2009, 11:28 pm
Posts: 384
Miles11 wrote:
Does anyone know why explorer is much slower to open c:\ than google, as below? I can click Start, My Computer and then C: much faster than AutoHotKey opens C: as per the second script below.

!x::
Start := A_TickCount
Run iexplore.exe http://www.google.com
MsgBox % A_TickCount - Start "ms have passed."
return

!y::
Start := A_TickCount
Run iexplore.exe C:\
MsgBox % A_TickCount - Start "ms have passed."
return


C:\ opens faster for me using the above tickcounts as measures. ~200ms if no explorer windows are open. opening to google takes 500-600ms if internet explorer isn't previously open.

However, I don't understand why they should be equal. You are loading two different things so obviously there will be a difference. Personally I find Sean's ShellNavigate() function fastest because it uses an already existing explorer window if one is available. Also, I use Firefox as my default internet browser, and have not optimized internet explorer's configuration - I only keep it around to get Windows Updates.

_________________
Hardware: 1.8 GHz laptop with 4 GB ram, Windows XP/SP3
Software: Prevx, Privatefirewall, KeyScrambler.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 14 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], BrandonHotkey, Exabot [Bot], krajan, patgenn123, Yahoo [Bot] and 61 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group