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 

illegal characters error when using send command

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



Joined: 10 Sep 2005
Posts: 27

PostPosted: Fri Aug 28, 2009 11:43 pm    Post subject: illegal characters error when using send command Reply with quote

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
View user's profile Send private message
horntail



Joined: 03 Aug 2009
Posts: 69
Location: UK

PostPosted: Sat Aug 29, 2009 12:09 am    Post subject: Re: illegal characters error when using send command Reply with quote

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
View user's profile Send private message
ncc1701d



Joined: 10 Sep 2005
Posts: 27

PostPosted: Sat Aug 29, 2009 12:57 am    Post subject: Reply with quote

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
View user's profile Send private message
horntail



Joined: 03 Aug 2009
Posts: 69
Location: UK

PostPosted: Sat Aug 29, 2009 1:05 am    Post subject: Reply with quote

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
View user's profile Send private message
sinkfaze



Joined: 18 Mar 2008
Posts: 5044
Location: the tunnel(?=light)

PostPosted: Sat Aug 29, 2009 3:17 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
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