Re: 'sort' command-alternative?
Re: 'sort' command-alternative?
- Subject: Re: 'sort' command-alternative?
- From: John Delacour <email@hidden>
- Date: Sun, 6 Oct 2002 20:18:44 +0100
- Mac-eudora-version: 5.3 alpha
At 10:29 am -0700 6/10/02, Paul Berkowitz wrote:
I tried it first with "a", which didn't work too well:
--> "�" displayed in a new TextEdit document
Not here. I get a in the dialog and 'a' in the TE doc.
What does this do, John? Why convert twice, back to where it came from?
At one point it was necessary. for some reason. Try this, which
also sewts the html file to zero.
tell app "TextEdit" to set s to get character 1 of document 1
set f to ":tmp:junk.txt"
set f2 to ":tmp:junk.html"
open for access file f with write permission
set eof file f to 0
write s to file f
close access file f
--
set pair to read file f
set n to 256 * (ASCII number (character 1 of pair))
set n to n + (ASCII number (character 2 of pair))
set htmlChar to "&#" & n & ";"
display dialog s & return & class of s & return & htmlChar
--
open for access file f2 with write permission
set eof file f2 to 0
write "<html>" & htmlChar & "</html>" to file f2
close access file f2
tell application "Finder" to open file f2
> display dialog htmlChar
--> "�"
I have no idea how you are getting this!
JD
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.