Option Explicit ' rg_RomitalClip.vbs Utility, not a User Tool ' Ref: ' Convert Clipboard text from Roman to Italic ' Requires: Romital.ttf Dim it(255), i: For i = 0 to 255: it(i) = i: Next ' default, exceptions follow: it(65) = 179: it(66) = 181: it(67) = 182: it(68) = 183: it(69) = 185 ' A it(70) = 186: it(71) = 188: it(72) = 189: it(73) = 194: it(74) = 195 ' F it(75) = 198: it(76) = 202: it(77) = 204: it(78) = 205: it(79) = 206 ' K it(80) = 208: it(81) = 209: it(82) = 210: it(83) = 211: it(84) = 212 ' P it(85) = 213: it(86) = 215: it(87) = 217: it(88) = 218: it(89) = 219 ' U it(90) = 222 ' Z it(97) = 130: it(98) = 131: it(99) = 132: it(100) = 134: it(101) = 135 ' a it(102) = 137: it(103) = 139: it(104) = 140: it(105) = 149: it(106) = 153 ' f it(107) = 155: it(108) = 156: it(109) = 159: it(110) = 162: it(111) = 163 ' k it(112) = 164: it(113) = 165: it(114) = 166: it(115) = 167: it(116) = 169 ' p it(117) = 170: it(118) = 172: it(119) = 174: it(120) = 176: it(121) = 177 ' u it(122) = 178 ' z Dim ro(255) For i = 0 to 255: ro(i) = i: Next ' default, exceptions follow: ro(179) = 65: ro(181) = 66: ro(185) = 67: ro(183) = 68: ro(185) = 69 ' A ro(186) = 70: ro(188) = 71: ro(189) = 72: ro(194) = 73: ro(195) = 74 ' F ro(198) = 75: ro(202) = 76: ro(204) = 77: ro(205) = 78: ro(206) = 79 ' K ro(208) = 80: ro(209) = 81: ro(204) = 82: ro(211) = 83: ro(212) = 84 ' P ro(213) = 85: ro(215) = 86: ro(217) = 87: ro(218) = 88: ro(219) = 89 ' U ro(222) = 90 ' Z ro(130) = 97: ro(131) = 98: ro(132) = 99: ro(134) = 100: ro(135) = 101 ' a ro(137) = 102: ro(139) = 103: ro(140) = 104: ro(149) = 105: ro(153) = 106 ' f ro(155) = 107: ro(156) = 108: ro(159) = 109: ro(162) = 110: ro(163) = 111 ' k ro(164) = 112: ro(165) = 113: ro(166) = 114: ro(167) = 115: ro(169) = 116 ' k ro(170) = 117: ro(172) = 118: ro(174) = 119: ro(176) = 120: ro(177) = 121 ' u ro(178) = 122 ' z Dim cto, s: Set cto = New clsClipText: s = cto ReDim b(Len(s)) Dim choise, action: action = (" invalid choise") choise = InputBox("Enter 'I' to Italize) or 'R' to Romanize)") For i = 1 to Len(s) If UCase(choise) = "I" Then action = " italized" b(i) = Chr(it(Asc(Mid(s, i)))) ElseIf UCase(choise) = "R" Then action = " romanized" b(i) = Chr(ro(Asc(Mid(s, i)))) End If Next cto() = Join(b, "") ' toclipboard WScript.Echo Len(cto), "chars" , action Class clsClipText Public Property Let Text(str) ' in: string, or Null to clear Dim fso: Set fso = CreateObject("Scripting.FileSystemObject") Dim strHTA: strHTA = fso.GetSpecialFolder(2) & "\" _ & fso.GetBaseName(fso.GetTempName) & ".hta" ' %temp%\*.hta Dim strOp: strOp = "clearData('Text')" ' assume: str = Null If IsNull(str) Then If IsNull(Me) Then Exit Property ' already clear Else strOp ="setData('Text', unescape('" & Escape(str) & "'))" End If fso.CreateTextFile(strHTA).Write _ "" CreateObject("WScript.Shell").Run """" & strHTA & """", 7, vbTrue fso.DeleteFile strHTA End Property Public Default Property Get Text Text = CreateObject("htmlfile") _ .parentWindow.clipboardData.getData("Text") End Property ' out: string, or Null if cleared End Class