Economy-x-Talk - Sample Scripts
Do text as HyperTalk
This script runs a selected HyperTalk script in a text editor. This version needs improvement.
set quote to "\""
set currApp to path to frontmost application as text
set rslt to ""
set newVar to ""
set theError to 0
tell application currApp
try
set selectVar to the selection as string
on error errMsg number errNr
set theError to errNr
set theErrorMsg to errMsg
end try
if theError is 0 then
repeat with x from 1 to ¬
(the count of characters of selectVar)
if (character x of selectVar is quote) or ¬
(character x of selectVar is "") or ¬
(character x of selectVar is "") then
set newVar to newVar & quote
else
set newVar to newVar & character x of selectVar
end if
end repeat
tell application "HyperCard"
set rslt to (do script newVar) as text
end tell
if rslt is not "" then display dialog rslt
else
if theError is 1900 then
beep
display dialog "Nothing Selected." buttons ¬
{"Cancel"} default button "Cancel" with icon 0
else
display dialog theErrorMsg
end if
end if
end tell
Keep this extensive resource of tutorials and samples on-line! Support RunRev.info!
| Yes, this script is useful. I make a donation and choose freely how much I want to donate on-line (PayPal). Click here if you want to make a donation in dollars. | This script has not (completely) solved my problem and I want Economy-x-Talk to take care of it. Let me contact you. |
Copyright©2002-2008 by Mark Schonewille, Nijmegen, the Netherlands. This web site is in no way affiliated with Runtime Revolution Ltd., but we do recommend the Revolution development platform.