| View previous topic :: View next topic |
| Author |
Message |
ncc1701d
Joined: 10 Sep 2005 Posts: 27
|
Posted: Fri Aug 28, 2009 11:43 pm Post subject: illegal characters error when using send command |
|
|
I have a script below I am testing. see below.
Run, C:\Program Files\Windows NT\Accessories\wordpad.exe
WinWait, Document - WordPad
WinActivate, Document - WordPad
WinWait, Document - WordPad
Send,
<table width="747" cellspacing="9" border="0" height="149">
<tr>
<td height="0">
<center>
<table width="93%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="27%">
All I want to do is open wordpad and type out the info you see after the Send, command. I get an error line 9 saying I am using illegal characters.
What is the best way for my goal to work. Can I even do it? Do I need a string thing or something. I dont understand strings anyway but...
Anyone have ideas on solving my problem?
thanks |
|
| Back to top |
|
 |
horntail
Joined: 03 Aug 2009 Posts: 69 Location: UK
|
Posted: Sat Aug 29, 2009 12:09 am Post subject: Re: illegal characters error when using send command |
|
|
The second winwait was pointless so i took it out, also the error was caused because you didnt put the delimiter "`" in front of your % signs so it thought you were placing variables
| Code: | Run, C:\Program Files\Windows NT\Accessories\wordpad.exe
WinWait, Document - WordPad
WinActivate, Document - WordPad
Send, <table width="747" cellspacing="9" border="0" height="149">{enter}<tr>{enter}<td height="0">{enter}<center>{enter}<table width="93`%" border="0" cellspacing="0" cellpadding="0">{enter}<tr> {enter}<td width="27`%">
|
btw sendinput is faster than send |
|
| Back to top |
|
 |
ncc1701d
Joined: 10 Sep 2005 Posts: 27
|
Posted: Sat Aug 29, 2009 12:57 am Post subject: |
|
|
Thanks on both counts. I didnt know about sendinput.
Can you answer this question for me?
When using sendinput or send does autohotkey always finish that which is typed out after using send before beginning the next autohotkey script line.
Or would I need some kind of wait command to wait for lines to be typed? |
|
| Back to top |
|
 |
horntail
Joined: 03 Aug 2009 Posts: 69 Location: UK
|
Posted: Sat Aug 29, 2009 1:05 am Post subject: |
|
|
| the send command wont complete untill it has sent everything, so autohotkey wont go to the next script line untill the send has finished |
|
| Back to top |
|
 |
sinkfaze
Joined: 18 Mar 2008 Posts: 5044 Location: the tunnel(?=light)
|
Posted: Sat Aug 29, 2009 3:17 am Post subject: |
|
|
| horntail wrote: | | the send command wont complete untill it has sent everything, so autohotkey wont go to the next script line untill the send has finished |
As an addendum to that, you may come across instances where it appears the script has advanced past a Send command even though not all text to be sent appeared to be sent, or, the text was sent incorrectly. You'll have to bear in mind that AHK only sends the data to another program, it has nothing to do with whether the other program receives/processes all of the data, or receives/processes all of it correctly. In most of these instances making script adjustments via SetKeyDelay will usually correct the problem. _________________ Try Quick Search for Autohotkey or see the tutorial for newbies. |
|
| Back to top |
|
 |
|