Re: Execute script code in email body
Re: Execute script code in email body
- Subject: Re: Execute script code in email body
- From: John Delacour <email@hidden>
- Date: Wed, 20 Nov 2002 22:46:00 +0000
- Mac-eudora-version: 5.3a9
At 7:46 am -0800 20/11/02, Paul Berkowitz wrote:
Only if everyone also has a scriptable script editor too. To turn ordinary
text into a script, you'd first have to create the script, meaning you'd
have to tell Smile (assuming you don't want to buy Script Debugger for
everyone) to make a new script, then run it. Or perhaps just 'run script' if
it's formatted correctly already.
Run script is fine, but you'd need to establish a tagging convention
for runnable scripts in mail. I wrote MIMI for Frontier some years
ago to allow Base64 encoded scripts in mail to be imported to
Frontier Root and run if required. For a while this was used as a
very convenient way of exchanging scripts and whole collections of
objects. One command in Frontier imports everything into the
database from the message.
=======================_Frontier_Mail_Object_=======================
Mimi-Version: 1.0b2X
Download-from:
http://www...../Mimi.html
Content-Encoding: base64
Content-Type: Frontier script
Runnable: false
Source-Address: @user.callbacks.startup.disabled.getASdict2
AAEEZAACAAAABgAAAAsAAAIAAA8GTW9uYWNvAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAkAAAAAAAAAAAAAAAAAALn0T3K599qrAAAACgAAAfQAnAK8Ah1hc2Ny////////
AAAAAAAAbWFjIAAAAAAAAAAAAAAAAHNldCB4IHRvIDENgAAAAAAA
========================_End_of_Mail_Object_========================
The same thing could easily be done for AppleScript scripts. SInce
an AppleScript script can be run as text, there is no need for the
encoding above, which contains all sorts of extra info. On the other
hand it would make the scripts mail safe and allow binaries to be
sent and run also.
If scripts were wrapped like this, the contents could be parsed and
treated according to the headers -- decoded if necessary. There is
no need for any Script Debugger or anything.
======================_AppleScript_Mail_Object_======================
Content-Encoding: none
Content-Type: text/plain
Charset: "macintosh"
Runnable: true
Source-Address: /tmp/scripts/runmailscript.scpt
tell app "Finder" to activate
==================_End_of__AppleScript Mail_Object_==================
A script to run the object would then be something like this, with
added stuff to deal appropriately with the headers.
"======================_AppleScript_Mail_Object_======================"
set a to result
"==================_End_of__AppleScript Mail_Object_=================="
set b to result
set script_ to ""
set found_ to false
set stop_ to false
set write_ to false
tell application "Eudora"
if stop_ then exit repeat
set msg to return & front message's body
repeat with para in paragraphs of msg
set line_ to contents of para
if line_ is a then set found_ to true
if found_ and line_ is "" then set write_ to true
if write_ then
if line_ is b then exit repeat
set script_ to script_ & line_ & return
end if
end repeat
run script script_
end tell
_______________________________________________
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.