AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

getting send to work

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
StarThorn1



Joined: 12 Nov 2009
Posts: 6

PostPosted: Thu Nov 12, 2009 8:46 pm    Post subject: getting send to work Reply with quote

Here is my script:



Numpad0 & Numpad1::
Run O:\
Run M:\
return

Numpad0 & Numpad2::
run cmd
send o:{Enter}
return



I want to open CMD and have it switch to my O: directory. It wont thought. When i press 0+2 I opens CMD but a message box pops up telling me that another script is trying to open.

Also whats return for? I read about it but its complex the way they define it. I'm guessing its something that allows you to use the hotkey over and over again....although I can do that without putting return in.
Back to top
View user's profile Send private message
MasterFocus



Joined: 08 Apr 2009
Posts: 3035
Location: Rio de Janeiro - RJ - Brasil

PostPosted: Thu Nov 12, 2009 8:54 pm    Post subject: Re: getting send to work Reply with quote

StarThorn1 wrote:
I want to open CMD and have it switch to my O: directory.

Try Run, %comspec% /c ...
_________________
"Read the manual. Read it again. Search the forum.
Try something before asking. Show what you've tried.
"

Antonio França
My stuff: Google Profile
Back to top
View user's profile Send private message Visit poster's website
Wingfat



Joined: 23 Aug 2004
Posts: 275
Location: East Bay, California USA

PostPosted: Thu Nov 12, 2009 9:41 pm    Post subject: Reply with quote

here is a code for Numpad1 (with the Ctrl Key pressed) to launch the CMD prompt. and then Numpad2 (with the Ctrl Key pressed) to type out the line you need... if you want to add in a CD\ to your O drive then change the This is a Test in this script:
Code:

^Numpad1::Run CMD
^Numpad2::
Sleep, 200
Send, This is a test
Return


I added the CTRL key to make it so you still can use the Numpad Keys for normal number typing.
_________________
----------------------------
Wingfool you fat! I mean, Wingfat you fool!
Line from Woody Allen's movie "What's Up Tiger Lilly?"
-----------------------------
Back to top
View user's profile Send private message
StarThorn1



Joined: 12 Nov 2009
Posts: 6

PostPosted: Fri Nov 13, 2009 1:14 pm    Post subject: Reply with quote

What was wrong with my script though? Did it not type O: because the script worked so fast the cmd window couldnt come in to focus?

also, why do you have a , after send?

also also, can you explain in plain English what return does?


Last edited by StarThorn1 on Fri Nov 13, 2009 1:28 pm; edited 1 time in total
Back to top
View user's profile Send private message
aaffe



Joined: 17 May 2007
Posts: 1002
Location: Germany - Deutschland

PostPosted: Fri Nov 13, 2009 1:22 pm    Post subject: Reply with quote

You have to
Code:
SetTitlematchmode, 2
Run,%COMSPEC%
WinWaitActive,cmd.exe
Send,o:{ENTER}
o:

StarThorn1 wrote:
What was wrong with my script though? Did it not type O: because the script worked so fast the cmd window couldnt come in to focus?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group