| View previous topic :: View next topic |
| Author |
Message |
lostworld Guest
|
Posted: Tue Feb 09, 2010 8:25 am Post subject: fileappend to write contents in different colours..possible? |
|
|
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
|
Posted: Tue Feb 09, 2010 10:02 am Post subject: |
|
|
| 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
|
Posted: Tue Feb 09, 2010 10:31 am Post subject: |
|
|
| 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
|
Posted: Tue Feb 09, 2010 10:55 am Post subject: |
|
|
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 |
|
 |
lostworld Guest
|
Posted: Tue Feb 09, 2010 10:59 am Post subject: |
|
|
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
|
Posted: Tue Feb 09, 2010 11:08 am Post subject: |
|
|
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 |
|
 |
lostworld Guest
|
Posted: Tue Feb 09, 2010 11:30 am Post subject: |
|
|
| thanks aaffe for a valuable info |
|
| Back to top |
|
 |
Guest
|
Posted: Tue Feb 09, 2010 12:36 pm Post subject: |
|
|
| lostworld wrote: | | thanks aaffe for a valuable info |  |
|
| Back to top |
|
 |
socom1880
Joined: 14 Aug 2008 Posts: 73
|
Posted: Wed Jul 28, 2010 11:04 pm Post subject: |
|
|
| 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 |
|
 |
Guest
|
Posted: Thu Jul 29, 2010 12:37 am Post subject: |
|
|
| Filename parameters do not necessary to be .TXT |
|
| Back to top |
|
 |
poo_noo
Joined: 08 Dec 2006 Posts: 248 Location: Sydney Australia
|
Posted: Thu Jul 29, 2010 12:46 am Post subject: |
|
|
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 |
|
 |
flyingDman
Joined: 27 Feb 2009 Posts: 690 Location: Burbank, California
|
Posted: Thu Jul 29, 2010 1:07 am Post subject: |
|
|
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 |
|
 |
guest3456 Guest
|
Posted: Thu Jul 29, 2010 1:21 am Post subject: |
|
|
| 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
|
Posted: Thu Jul 29, 2010 4:30 am Post subject: |
|
|
| 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 |
|
 |
aaffe
Joined: 17 May 2007 Posts: 1002 Location: Germany - Deutschland
|
Posted: Thu Jul 29, 2010 7:00 am Post subject: |
|
|
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 |
|
 |
|