ValeryVal Posted February 6, 2009 Share Posted February 6, 2009 This script SciEdToYahoo.au3 can help you write out syntax highlighting of source on Yahoo.How it is highlighted by Yahoo see hereHow it works:1. Write AutoIt script by Scied editor.2. Export it as HTML3. Open this html file in any simple text editor (Notepad or other)4. Start this SciEdToYahoo.au3. Script has three Hotkeys - {Ctrl-g}- call func Convert, {Alt-m} - call func Message and Esc - exit.5. Return into editor window. Select all content and press {Ctrl-g}. New content of text editor will be converted into form recognized by Yahoo rich text editor. Don't close this window.6. Start new message for Yahoo group. Select mode Yahoo rich text editor and check on View HTML Source.7. Now you can paste curent content of clipboard (for Yahoo rich text editor) - {Ctrl-v}. If clipboard was changed then you can get rich text of script from window of simple editor (See 5. Above) - {Ctrl-a} and paste it for Yahoo.;===================================; Convert SCIED html text from clipboard; to Yahoo html textGlobal $T,$S,$TsHotKeySet("^g", "Convert")HotKeySet("{ESC}", "Terminate")HotKeySet("!m", "Message") ;Alt-mCreateTemplate()while 1 Sleep(100)wEndfunc Terminate() Exit 0endfuncfunc Message() MsgBox(4096,"","It works.")endfunc;===================================; Convert text of clipboard to Yahoo HTML codefunc Convert()local $Contentlocal $Start = '<body bgcolor="#FFFFFF">'local $End = '</body>' Send("^c") $Content = ClipGet() $x = 1 if StringInStr($Content,$Start) then $x = StringInStr($Content, $Start) + StringLen($Start) $y = StringLen(StringTrimLeft($Content, $x)) if StringInStr($Content, $End) then $y = StringInStr(StringTrimLeft($Content, $x), $End) $Content = StringMid($Content, $x, $y) $Content = StringReplace($Content, "<span>", $Ts) for $i = 1 to $S[0] $Content = StringReplace($Content, 'class="S' & $S[$i] & '">', 'style="' & $T[$i] & ';">') next ClipPut($Content) Send("^v")endfunc;===================================; Make conversion templatefunc CreateTemplate()$Tc = ""$Tc &= "color: rgb(0, 0, 0)/"$Tc &= "font-style: italic; color: rgb(0, 153, 51)/"$Tc &= "font-style: italic; color: rgb(102, 153, 0)/"$Tc &= "font-style: italic; font-weight: bold; color: rgb(172, 0, 169)/"$Tc &= "font-style: italic; font-weight: bold; color: rgb(0, 0, 144)/"$Tc &= "font-weight: bold; color: rgb(0, 0, 255)/"$Tc &= "font-weight: bold;color: rgb(255, 51, 255)/"$Tc &= "font-weight: bold; color: rgb(153, 153, 204)/"$Tc &= "font-weight: bold; color: rgb(255, 0, 0)/"$Tc &= "font-weight: bold; color: rgb(170, 0, 0)/"$Tc &= "font-style: italic; color: rgb(240, 0, 255)/"$Tc &= "font-style: italic;color: rgb(160, 15, 240)/"$Tc &= "font-style: italic; color: rgb(160, 15, 240/"$Tc &= "font-style: italic; font-weight: bold; color: rgb(0, 0, 255)/"$Tc &= "font-style: italic; font-weight: bold; color: rgb(111, 111, 179)"$T = StringSplit($Tc,"/")$S = StringSplit("0,1,2,3,4,5,6,7,8,9,11,12,14,15",",")$Ts = "<span style=""font-family: 'Courier New'; color: rgb(0, 0, 0); font-size: 10pt;"">"endfuncValery The point of world view Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now