Subscript text vs unicode
The script is working fine for years but I would like also let it work with subscript text...
When I have a subscript 2 it becomes a normal 2.
How can I get subscript 2 recognized as a subscript 2
Any help would be wonderful!
Many thanks!
-- SCRIPT
(*
This scirpt will modify given text (in Latin-1 encoding) such that
(1) every semicolon is replaced by tab
(2) its text encoding is converted from Latin-1 to Mac-Roman
* Using Satimage OSAX's
change
convert to Mac
Preparation:
Install Satimage OSAX in:
under OS9
System Folder:Scripting Additions:
under OSX (either of the followings)
/Library/ScriptingAdditions/
~/Library/ScriptingAdditions/
* OSAX download sources:
http://www.satimage.fr/software/en/soft9.html
http://www.satimage.fr/software/en/downloads_osaxen.html
*)
main()
on main()
set fdp to "HD Server Data 1:DATABASES map:TEST:"
set fda to fdp as alias
tell application "Finder"
try
set aa to (files of fda whose name extension is "txt") as alias list
on error
set aa to (files of fda whose name extension is "txt") as alias as list
end try
end tell
repeat with a in aa
set fp0 to a as text
set fp1 to (fp0's text 1 thru -5) & "_mac.txt"
set t to read file fp0
set t to «event SATIRPLl» ";" given «class by »:tab, «class $in »:t
set t to «event SATIWn2M» t
writeData(fp1, t, {_class:string, _append:false}) -- # if you need text in Mac-Roman
--writeData(fp1, t, {_class:«class utf8», _append:false}) -- # if you need text in UTF-8
end repeat
end main
on writeData(fp, x, {_class:typeclass, append:append})
(*
text fp: output file path
data x: anything to be written to output file
type class typeclass: class as which the data is written ("" for not-specified)
boolean _append: whether to append data or to replace data
*)
local a
try
open for access (file fp) with write permission
set a to fp as alias
if not _append then set eof a to 0
if typeclass = "" then
write x to a starting at eof
else
write x to a as typeclass starting at eof
end if
close access a
on error e
try
close access file fp
on error --
end try
error e
end try
end writeData
-- END OF SCRIPT
Different workstations from 10.3.9 to latest// G5 server - OS 10.3.9, Mac OS X (10.5.6)