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 

How to SendInput, {raw} %ini_variable_with_carriage_returns%

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



Joined: 13 Aug 2007
Posts: 11

PostPosted: Sun Aug 19, 2007 1:40 am    Post subject: How to SendInput, {raw} %ini_variable_with_carriage_returns% Reply with quote

Hello,

How do I use SendInput, {raw} to send a variable with carriage returns that is stored in an ini file?

For example

test.ini:

Code:

[scripts]
send=(
line 1
line 2
line 3
line 4
etc.
)



AHK Script:

Code:

IniRead, sAudit, test.ini, scripts, send, %A_Space%

f::

Sendinput, {raw} %sAudit%

return


I assume the problem is with iniread not being able to send the carriage returns. If so, is there a way around this? If not, how can I do it? Lastly, is there a better way to store these variables outside the ahk script? Ultimately, I want these variables to be easily configured and shared amoung users. I'm not married to the ini format.

Thanks in advance. Z
Back to top
View user's profile Send private message
engunneer



Joined: 30 Aug 2005
Posts: 6804
Location: Pacific Northwest, US

PostPosted: Sun Aug 19, 2007 4:22 am    Post subject: Reply with quote

iniread can only read the one line. you should do a stringreplace on the thing you are saving (replace `n with something else, like {enter})

then when you read it back in, you can send it directly (not raw) or stringreplace your line back to `n
_________________
Unless otherwise noted, all code is untested.
Common Answers: 1.(Loops, Viruses, etc.) 2. Search 3.RTFM
Back to top
View user's profile Send private message Visit poster's website
z3lig



Joined: 13 Aug 2007
Posts: 11

PostPosted: Sun Aug 19, 2007 4:42 am    Post subject: Reply with quote

I'm considering using xml files to store this. Seems like Titan's XMLPath script may be a good solution for what I'm trying to do. If anyone thinks this is not the right path to go down, please advise.


Z
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   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