Re: Applescript URL protocol (Was applescript & HTML)
Re: Applescript URL protocol (Was applescript & HTML)
- Subject: Re: Applescript URL protocol (Was applescript & HTML)
- From: Graff <email@hidden>
- Date: Fri, 26 Mar 2004 05:39:05 -0500
On Mar 26, 2004, at 4:54 AM, Brennan wrote:
On 25/3/04 at 14:41, Graff <email@hidden> wrote:
In fact, the way I'd go about that would be to make a program that
took the text of a script, did a base64 encoding on it, and then
presented you with the text that you could cut and paste somewhere.
Someone who received the message could then paste that text into a
base64 decoder and get back the original text of the script.
It's a bit of a pain but it should work.
It's certainly a bit of a pain, compared to the applescript: protocol,
which is otherwise custom built for what we want.
(I am having great difficulty restraining myself right now from
castigating the relevant Apple list administrators for not supporting
high
byte characters in a more sensible way. They are effectively making the
applescript: protocol almost useless)
Back to the point; I was recently looking at using 'do shell script' to
call the built in UNIX base64 encoder (part of the OpenSSL command).
It works well, but AFAICT relies on the input being a file. :(
openssl base64 -in file.bin -out file.b64
Of course we can write the string temporarily to (path to "flnt") but
that
seems kind of overkill.
Can anyone fathom the man pages ('man enc') to the point where they can
pass a string (with high byte chars, or perhaps unicode) directly to
this
command for encoding as 7bit text?
Is there another shell command for doing this?
If you want to use openssl just do this:
echo 'this is a test' | openssl base64
To decode just add the -d switch:
echo 'this is a test' | openssl base64 | openssl base64 -d
Another command to do this is uuencode:
echo 'this is a test' | uuencode -m thescript
The -m switch gives you base64 encoding.
uuencoded data is also regular ASCII so you can do this to get
uuencoded text:
echo 'this is a test' | uuencode thescript
-Ken
_______________________________________________
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.