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 

fileappend to write contents in different colours..possible?
Goto page 1, 2  Next
 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
lostworld
Guest





PostPosted: Tue Feb 09, 2010 8:25 am    Post subject: fileappend to write contents in different colours..possible? Reply with quote

hi guys...i want to know whether is it possible to write a file content in different colour say for example when i use this command

Code:

FileAppend, hi how are you?,xyz.txt ;;;; can i write the content hi how are you in red colour in txt format file???
Back to top
Guest






PostPosted: Tue Feb 09, 2010 10:02 am    Post subject: Reply with quote

Yes and No. Color display depends on the program showing the text. You can certainly use FileAppend to write text to a file, and if you have (for instance) the proper RichText codes imbedded in the text, then a richtext application (an editor for example) will show the colored text.
Back to top
lostworld
Guest





PostPosted: Tue Feb 09, 2010 10:31 am    Post subject: Reply with quote

ya thanks but i think to write into a simple notepad it wont work
Back to top
aaffe



Joined: 17 May 2007
Posts: 1002
Location: Germany - Deutschland

PostPosted: Tue Feb 09, 2010 10:55 am    Post subject: Reply with quote

Where can you define colors in notepad??? I cant at mine.
Btw: Fileappend doesnt write text to notepad but in a txt file.
lostworld wrote:
ya thanks but i think to write into a simple notepad it wont work
Back to top
View user's profile Send private message
lostworld
Guest





PostPosted: Tue Feb 09, 2010 10:59 am    Post subject: Reply with quote

thats right i wish something like this would get implemented in coming days
FileAppend,hi how are you?,xyz.txt,cred
Back to top
aaffe



Joined: 17 May 2007
Posts: 1002
Location: Germany - Deutschland

PostPosted: Tue Feb 09, 2010 11:08 am    Post subject: Reply with quote

But Notepad CANT show text in colors. Thats the problem, not ahk.
You can paste text to a html-file and define there colors of the text. then the text would be colored when the html file generated by ahk would be opened.
Back to top
View user's profile Send private message
lostworld
Guest





PostPosted: Tue Feb 09, 2010 11:30 am    Post subject: Reply with quote

thanks aaffe for a valuable info
Back to top
Guest






PostPosted: Tue Feb 09, 2010 12:36 pm    Post subject: Reply with quote

lostworld wrote:
thanks aaffe for a valuable info
Rolling Eyes
Back to top
socom1880



Joined: 14 Aug 2008
Posts: 73

PostPosted: Wed Jul 28, 2010 11:04 pm    Post subject: Reply with quote

aaffe wrote:
But Notepad CANT show text in colors. Thats the problem, not ahk.
You can paste text to a html-file and define there colors of the text. then the text would be colored when the html file generated by ahk would be opened.


How can this be done? Would I just need to look up html code? And how could ahk write to a .html file? I thought it could only write to .txt files.
Back to top
View user's profile Send private message
Guest






PostPosted: Thu Jul 29, 2010 12:37 am    Post subject: Reply with quote

Filename parameters do not necessary to be .TXT
Back to top
poo_noo



Joined: 08 Dec 2006
Posts: 248
Location: Sydney Australia

PostPosted: Thu Jul 29, 2010 12:46 am    Post subject: Reply with quote

a small code snippet to create & open a HTML file

Code:
; create the html
FileAppend,
(
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>HELLO</title>
<style type="text/css">
<!--
.style1 {
   font-family: Arial, Helvetica, sans-serif;
   font-size: 72px;
   color: #0000FF;
}
.style2 {
   font-family: Webdings;
   color: #006600;
}
.style5 {color: #006600}
.style6 {
   color: #FF9900;
   font-size: 24px;
   font-family: Arial, Helvetica, sans-serif;
}
.style7 {font-family: Arial, Helvetica, sans-serif}
-->
</style>
</head>
<body>
<p class="style1">Happy Birthday !</p>
<p class="style1">Enjoy the Day! Blue TEXT</p>
<p class="style7">1233333333333</p>
<p class="style6">Orange Text</p>
<p class="style7">Mobile</p>
<p class="style7">Fax</p>
<p class="style7">Address</p>
<p class="style7">Web:</p>
<span class="style2">P</span><span class="style5"> Please consider the environment before printing this e-mail</span></p>
</body>
</html>
),test123.html
run, test123.html

_________________
Paul O
Back to top
View user's profile Send private message Visit poster's website
flyingDman



Joined: 27 Feb 2009
Posts: 690
Location: Burbank, California

PostPosted: Thu Jul 29, 2010 1:07 am    Post subject: Reply with quote

also see:

Topic: www.autohotkey.com/forum/viewtopic.php?t=60215
_________________
"Data is not information, information is not knowledge, knowledge is not understanding, understanding is not wisdom" but let's start to get the data...
Back to top
View user's profile Send private message
guest3456
Guest





PostPosted: Thu Jul 29, 2010 1:21 am    Post subject: Reply with quote

lostworld wrote:
thats right i wish something like this would get implemented in coming days
FileAppend,hi how are you?,xyz.txt,cred


as was said, the problem is with your text editor, in this case notepad, not with FileAppend command

basic example for html file:

Code:

FileAppend, <font color="red">hi how are you?</font>, xyz.html
Back to top
socom1880



Joined: 14 Aug 2008
Posts: 73

PostPosted: Thu Jul 29, 2010 4:30 am    Post subject: Reply with quote

guest3456 wrote:
lostworld wrote:
thats right i wish something like this would get implemented in coming days
FileAppend,hi how are you?,xyz.txt,cred


as was said, the problem is with your text editor, in this case notepad, not with FileAppend command

basic example for html file:

Code:

FileAppend, <font color="red">hi how are you?</font>, xyz.html


Thanks, thats super easy and works well. The only thing is the `n as an enter isn't working. Is there some other way to append an enter character to the .html file?
Back to top
View user's profile Send private message
aaffe



Joined: 17 May 2007
Posts: 1002
Location: Germany - Deutschland

PostPosted: Thu Jul 29, 2010 7:00 am    Post subject: Reply with quote

Yes, there is. You should look into the definition of html-files.
Just google for it.
Or look into here:
http://www.utexas.edu/learn/html/
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
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