Re: AppleScript e-mail encode/decode tool
Re: AppleScript e-mail encode/decode tool
- Subject: Re: AppleScript e-mail encode/decode tool
- From: Joshua Juran <email@hidden>
- Date: Mon, 19 Feb 2001 02:13:42 -0500
At 8:27 AM -0500 2001-02-17, Bill Cheeseman wrote:
>
A script that uses the clipboard to encode and decode AppleScripts for
>
e-mail transmission has been posted by Wolf Rentzsch on the AppleScript
>
Implementors list. He invited somebody to post it on applescript-users, too,
>
but I'm going to make a couple of changes to it this morning before I do so.
>
I will identify it as version 1.0.1WJC, in case others are also making
>
changes to it.
>
>
A couple of comments:
>
>
I realize that, with more than one encode/decode script floating around and
>
a C utility promised, we will now have a Tower of Babel problem: lots of
That's C++. You think I'm some kind of masochist?
>
mutually incompatible encoded scripts. So Chris and Chuq need to keep
>
working on this issue from their end. Maybe some enterprising soul will
>
write a utility to recognize which encoding script was used and launch the
>
correct decoding script -- but it won't be me! One of the changes I will
>
make to Wolf's script is to have it include his encode/decode script name
>
and version number in the encoded output, and a warning in the decode branch
>
if the encoded script doesn't include the same comment string.
I think a common format for encoded scripts should be agreed on, and then
list members can use whatever tool they prefer to decode them.
>
I prefer Wolf's technique, but not just because it uses the clipboard. I
An application has a slight problem with this -- since the email program
must be in front (to use the clipboard), how do you launch the application
without disturbing the layer order, or at least restore it afterward? In
another message I toyed with the idea of using Apple events to munge the
selection in-place. This doesn't require the email program in front, but
the tool still must know which program to talk to. I guess the way to do
this is to use document files that contain the creator of the email
program. Open the document, and the tool talks to that program for you and
brings it back to the front. Unless someone has a more elegant workaround.
>
prefer having escaped hex codes over made-up equivalents in an encoded
>
script, for fear that some people will think the equivalents are part of the
>
language. I understand the counter-argument (that the equivalents are more
>
human-readable).
I'm negotiable on this. I think we should pick a formula that would work
for every possible script and make it the standard. Which one it is
doesn't concern me that much.
>
Note that Wolf's script does not convert some un-e-mailable symbols to their
>
longer AppleScript equivalents (e.g., greater than or equal). It only
>
encodes single characters as their hex equivalents. At present, it doesn't
>
encode all the characters that it should, but I'll fix that.
Any 8-bit character could appear in a quoted string, so the encoding should
handle all of them.
>
Also, note that none of these scripts converts a script to HTML that can be
>
manually copied back from a web page and compiled in a script editor without
>
change. If you're interested in doing that, see the Script2HTML script in
>
the "Scripts" chapter of The AppleScript Sourcebook.
Since the Web doesn't use the Mac character set, some scripts can't be
successfully represented in HTML. But I suppose it would be trivial to
tweak the script so it's 7-bit only.
I'm not going to add an incompatible tool to the mix. But given a spec to
implement and sufficient interest (one other person), I'll get to work. I
jst don't want to create a tool that doesn't get used.
Just be glad we're not posting MPW Makefiles. :-)
Josh
--
Joshua Juran Metamage Software Creations
=) Tools for Wizards
email@hidden
<
http://www.metamage.com/> * Creation at the highest state of the art *