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 

BufferInput On|Off

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Wish List
View previous topic :: View next topic  
Author Message
instantrunoff



Joined: 13 Jan 2008
Posts: 81

PostPosted: Sat May 17, 2008 8:58 pm    Post subject: BufferInput On|Off Reply with quote

Send {Raw} is in effect for the remainder of the string, but if you want to send a long string and have only some parts be raw you need to have multiple commands:
Code:
Send ^{f9}INCLUDEPICTURE "
   Send {Raw}%imagew%
   Send "{f9}{end}{space}<br><br><img src="
   Send {Raw}%image%">

The problem is that if you are using Sendmode Input or Play, text may not be buffered between Send commands (yes? no?). Something like {Raw0} to turn Raw off would be helpful:
Code:
Send {Raw}rawtext{Raw0}parse this text{Raw}morerawtext
This could get complicated though if you really wanted to send {Raw0} as literal text.

Even better then, perhaps, would be a command like BufferInput On|Off where all input would be buffered (rather than blocked like with BlockInput).
Back to top
View user's profile Send private message Visit poster's website
Ian



Joined: 15 Jul 2007
Posts: 1158
Location: Enterprise, Alabama

PostPosted: Sat May 17, 2008 9:07 pm    Post subject: Reply with quote

Code:
F1::
Send. ^{F9}INCLUDEPICTURE "%imagew%{F9}{End}{Space}<br><br><img src="%image%">


Did you try that?
_________________
ScriptPad/~dieom/dieom/izwian2k7/Trikster/God

Back to top
View user's profile Send private message
instantrunoff



Joined: 13 Jan 2008
Posts: 81

PostPosted: Sat May 17, 2008 9:11 pm    Post subject: Reply with quote

Ian wrote:
Code:
F1::
Send. ^{F9}INCLUDEPICTURE "%imagew%{F9}{End}{Space}<br><br><img src="%image%">


Did you try that?


I'm including {Raw} in case the variables contain strings with +, !, etc. Is "Send." with a period a special command?
Back to top
View user's profile Send private message Visit poster's website
Ian



Joined: 15 Jul 2007
Posts: 1158
Location: Enterprise, Alabama

PostPosted: Sat May 17, 2008 9:29 pm    Post subject: Reply with quote

When the script sends a variable, the special chars (!, +, ^, etc..) are replaced with their literal counterparts. In other words, when you send a variable, it sends only alpha numerical characters.
_________________
ScriptPad/~dieom/dieom/izwian2k7/Trikster/God

Back to top
View user's profile Send private message
instantrunoff



Joined: 13 Jan 2008
Posts: 81

PostPosted: Sat May 17, 2008 10:11 pm    Post subject: Reply with quote

Ian wrote:
When the script sends a variable, the special chars (!, +, ^, etc..) are replaced with their literal counterparts. In other words, when you send a variable, it sends only alpha numerical characters.


I have found that to be incorrect. A variable containing a string that includes, for example, "{enter}" will send an Enter keystroke with Send %var% unless {Raw} is specified. However, other characters in a string that need to be escaped using ` (like a comma) in a normal AHK command do not need to be similarly escaped if they are contained in a variable and the variable is sent.
Back to top
View user's profile Send private message Visit poster's website
Guest






PostPosted: Sun May 18, 2008 10:38 am    Post subject: Re: {Raw}, {RawVar}, {RawUntil} - was: BufferInput On|Off Reply with quote

instantrunoff wrote:
This could get complicated though if you really wanted to send {Raw0} as literal text.

...exactly...perhaps something like one of these would be good?...

Code:
Send, ^{f9}INCLUDEPICTURE "{Raw %imagew%}"{f9}{end}{space}<br><br><img src="{Raw %image%}">

...{Raw} would function as-is, but {Raw <with-something-here>} would take it as text or a var (in %'s) to send raw...

Code:
Send, ^{f9}INCLUDEPICTURE "{RawVar imagew}"{f9}{end}{space}<br><br><img src="{RawVar image}">

...{RawVar} would accept only a var & send it raw...

Code:
Send, ^{f9}INCLUDEPICTURE "{RawUntil="{RawEnd}"}%imagew%{RawEnd}"{f9}{end}{space}<br><br><img src="{RawUntil="{RawEnd}"}%image%{RawEnd}">

...{RawUntil="{RawEnd}"} would turn on raw until the string specified is reached...{RawUntil} by itself could default to {RawEnd} or {/RawUntil} so if using the default you don't need to specify it...

Code:
Send, ^{f9}INCLUDEPICTURE "{RawUntil}%imagew%{RawEnd}"{f9}{end}{space}<br><br><img src="{RawUntil}%image%{RawEnd}">

...or...

Code:
Send, ^{f9}INCLUDEPICTURE "{RawUntil="{somethingelse}"}%imagew%{somethingelse}"{f9}{end}{space}<br><br><img src="{RawUntil="{somethingelse}"}%image%{somethingelse}">

...perhaps also have a RawUntil command to set the default...

Code:
RawUntil, {myendrawstring}
Send, ^{f9}INCLUDEPICTURE "{RawUntil}%imagew%{myendrawstring}"{f9}{end}{space}<br><br><img src="{RawUntil}%image%{myendrawstring}">

...the raw end string should probably be case-sensitive...

One more variation...

Code:
Send, ^{f9}INCLUDEPICTURE "{RawVar}%imagew%"{f9}{end}{space}<br><br><img src="%image%">

...{RawVar}, like {Raw} would say that from this position to the end of the string all variables are sent raw, but literal text is not raw...again the problem of turning it off mid-string, but maybe still useful?...
Back to top
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Wish List 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