Ruby Script
[Professional and Corporate Editions Only]
You can use Ruby Script to generate all or parts of your message. To engage the script, use the Script macro. Below you can find more details:
Language name: RubyScript
Distributor: Arton
Web site: http://www.geocities.co.jp/SiliconValley-PaloAlto/9251/ruby/main.html
Installation: The distributer provides ActiveRuby installer that installs both the language interpreter and active scriting engine.
Known issues:
If your script contains syntax errors Ruby script engine may hang or crash.
Ruby script engine does not report run-time errors. Therefore, if errors occur, the messages may not appear as intended, but you will not see an error message. Do preview before sending.
In some situations, non-ascii characters (such as Japanese or Russians) may be treated incorrectly. If you use such characters, test carefully.
Values retrieved from data fields of currency type are treated incorrectly.
If you want variables to persist while the script switches from one recipient to other they must be global. Names of such variables must start with dollar sign ($).
Sample script
hours = @recipient.Hours
if hours.unknown
worked = 0
else
worked = hours.value
end
left = 10 - worked
if left <= 0
@document.skip
else
@document.write(@recipient.item("Supervisor").text)
@document.write(" reports that you ")
if worked == 0
@document.write(" have not worked on your assignment. ")
else
@document.write("only worked for ")
if worked == 1
@document.write(" one hour. ")
else
@document.write("#{worked} hours. ")
end
end
@document.write("You need ")
if left == 1
@document.write(" one more hour. ")
else
@document.write("#{left} more hours. ")
end
end
|