Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


CTRL+I (Please help)

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,3510
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> CTRL+I (Please help)
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 CTRL+I (Please help) - 6/23/2005 10:49:55 AM   
  pbrundog

 

Posts: 13
Score: 0
Joined: 6/23/2005
From: USA
Status: offline
I need to send the key combo CTRL+I in an application,

dim Pb1
set Pb1 = CreateObject("WScript.Shell")
Pb1.run "ARUser" , 1
WScript.sleep 1000
Pb1.sendkeys "pb{tab}pb{tab}~"
WScript.sleep 5000
Pb1.sendkeys "(^I)"

that's my application so far, but when it should do the CTRL+I nothing happens, I've tried like "^(I)" among many other things but none have worked, can anyone tell me how to send CTRL+I?

_____________________________

TV may make you feel ignorant, but nothing rubs it in quite like a computer.
 
 
Post #: 1
 
 Re: CTRL+I (Please help) - 6/23/2005 11:17:28 AM   
  Xandros

 

Posts: 100
Score: 0
Joined: 6/23/2005
From:
Status: offline
I believe the correct syntax is pb1.sendkeys "^I"

If that doesn't work, try "{^I}". I'm nearly certain that using parentheses is incorrect which are used for sending repeating keys and cannot be used with "combo" keys like ctrl, shift, & alt.

(in reply to pbrundog)
 
 
Post #: 2
 
 Re: CTRL+I (Please help) - 6/23/2005 11:22:47 AM   
  pbrundog

 

Posts: 13
Score: 0
Joined: 6/23/2005
From: USA
Status: offline
sigh, ya "^I" was my first guess, then "(^I)" "^(I)" and so on and so forth, but none of those works, nor does
"{^I}" <--that one gives a runtime error while all others simply have no effect at all

(in reply to pbrundog)
 
 
Post #: 3
 
 Re: CTRL+I (Please help) - 6/23/2005 12:05:54 PM   
  marcusrp

 

Posts: 145
Score: 0
Joined: 4/19/2005
From:
Status: offline
I believe the correct syntax is "^(i)"...sendkeys uses a literal translation, so it will interpret "I" as a capital I. So it will send nothing meaningful, since you don't include the "+" operator to send a shift. That would be my guess, I hate using sendkeys since it can get so complicated, especially if you have to send a lot of keystrokes.

(in reply to pbrundog)
 
 
Post #: 4
 
 Re: CTRL+I (Please help) - 6/23/2005 12:24:31 PM   
  pbrundog

 

Posts: 13
Score: 0
Joined: 6/23/2005
From: USA
Status: offline
wow, capitalization matters... that's the most ignorant thing I've seen since the language does not care about capitalization

this did fix it btw, thx ^_^

(in reply to pbrundog)
 
 
Post #: 5
 
 Re: CTRL+I (Please help) - 6/23/2005 12:57:51 PM   
  Xandros

 

Posts: 100
Score: 0
Joined: 6/23/2005
From:
Status: offline
Marcus, you're right about about sendkeys seeming to be complicated... flakey is how I'd describe it. BTW, it works for me without the parentheses also... just "^i". I'm still not getting "{INS}" to be recognized however and I've never discovered how to send other "special" keys such as the large plus key on the numeric keypad... my text editor uses it for special purposes.

(in reply to pbrundog)
 
 
Post #: 6
 
 Re: CTRL+I (Please help) - 6/23/2005 2:50:17 PM   
  pbrundog

 

Posts: 13
Score: 0
Joined: 6/23/2005
From: USA
Status: offline
I have heard there's a way to use the keyboard map (where it tells u a number for every key) and sendkeys to cooperate in what you are trying to accomplish Xandros, but I do not know the specifics, I also am interested to figure that out, if I find the answer I'll post it for you

(in reply to pbrundog)
 
 
Post #: 7
 
 Re: CTRL+I (Please help) - 6/23/2005 3:04:28 PM   
  Xandros

 

Posts: 100
Score: 0
Joined: 6/23/2005
From:
Status: offline
Thanks.

I discovered a few minutes ago that using {INSERT} works where {INS} did not... go figure!
Also, just found out (google search) that SendKeys in .net is doumented as supporting the +, -, *, and / keys on the numeric keypad... but using {ADD}, which is defined to be the large PLUS key, doesn't work in VBScript

(in reply to pbrundog)
 
 
Post #: 8
 
 Re: CTRL+I (Please help) - 6/24/2005 5:26:26 AM   
  marcusrp

 

Posts: 145
Score: 0
Joined: 4/19/2005
From:
Status: offline
sendkeys is like macros...its like a robot typing out the keys instead of you, thats the way I think of it. So case has to be factored in (since when I type I have to press the shift key to send a capital letter), and oddities such as using +, ^, %, etc. as operators AND needing to use their literal keystroke representation have to be accounted for when writing a script.
If you read the following, it seems as if even the microsoft engineers who do these writeups seem befuddled by some of the rules.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/wsmthsendkeys.asp

(in reply to pbrundog)
 
 
Post #: 9
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> CTRL+I (Please help) Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts