MACSCRPT Archives

February 2006

MACSCRPT@LISTSERV.DARTMOUTH.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Bill Steele <[log in to unmask]>
Reply To:
Macintosh Scripting Systems <[log in to unmask]>
Date:
Thu, 16 Feb 2006 09:37:27 -0500
Content-Type:
text/plain
Parts/Attachments:
text/plain (66 lines)
>Hi Bill,
>
>Your message is not extremely clear.

Sorry if I was misleading.  No e-mail files are involved.  The text 
starts as a Word document, gets copied into Tex-Edit Plus, where some 
code I stole converts to HTML. The HTML version eventually goes to 
the Web. I use the HTML tags to find various parts of the text 
(title, contact info, etc) and take them apart, then strip the tags 
to get straight text again. The straight text goes a couple of 
different places, all of which are fine except for one.

>
>Is the 'Unicode' problem in the name of the files or the text inside
>the resulting file?
>
>If it is in the text inside the file, which application are you using
>(telling) to manipulate (and save) the file?  And which MacOS are you
>using, OSX?  10.4.4?

It's the text. OS 10.3.9.  After the HTML conversion all the 
manipulations--mostly concatenation--are done inside Applescript. 
Finally the result is written to a file.  I open the file in 
Text-Edit and get (what seems to be) Unicode.  When I open another 
file -- supposedly created the same  way -- plain text..

>In that case, your problem is to translate the text from Unicode (or
>whatever) to ASCII.  Unicode to ASCII is easy to do in many ways.  My
>fav is to grab the free (lite) version of BBEdit, and "Zap Gremlins".

Yes, Tex-Edit's "strip high ASCII characters" works.  But later on 
the script reads the file and uses parts of it for something else, 
and the problem shows up there. I'd rather avoid the extra step of 
opening in Tex-Edit (or BBEdit) and processing it.

I've trashed all the offending files. I'll send along a snippet of 
text the next time I get one.


>
>
>>  Subject: Unicode madness
>>  From: Bill Steele <[log in to unmask]>
>>  Date: Wed, Feb 15, 2006 at 2:09 PM
>>  Reply-To: Macintosh Scripting Systems <[log in to unmask]>
>>  To: [log in to unmask]
>>
>>  I have a script that massages some text, then puts it into a number
>>  of different files with various headers and footers.
>>  Simplfied example:
>>  set page1 to theName & retutrn & theAddress & theText & page1Footer
>>  set page 2 to otherName & myEmail & theText & page2Footer
>>  So most of these work fine, but one out of the whole script creates a
>>  file apparently written in Unicode.  Scrolling through it with an
>>  arrow key requires two jumps per character, pasting into Word
>>  produces organized gibberish, and pasting onto a web page results in
>>  only the first character appearing.
>>  What is it about that one page...?  Or more to the point, when does
>>  Applescript automatically turn text into Unicode?


-- 

Bill Steele
[log in to unmask]

ATOM RSS1 RSS2