Shayton Equilibrium Kitchen Utensil 2003 用户手册

下载
页码 194
166 
 Chapter 3 
• 
• 
• 
Examples
The following script uses the MediaGenClient COM object to call another MediaScript. 
function main()
{
  var mgen = COMCreateObject("MediaGenClient.MGClient");
  mgen.ScriptName = "testtext.ms";
  mgen.SetParameter("args", 20);
  mgen.ExecuteScript();  
  mgen.SaveBuffer(System.getNativePath("write:/comsave.jpg"));
  resp.setPath("write:/comsave.jpg");
NOTE: 
This example is not generally recommended as it can cause deadlocks. It is provided for 
instructional purposes only.
 
e r r o r ( )
This function has been deprecated. Use the standard JavaScript try..catch..finally 
and throw syntax instead.
g e t P r o p e r t y V a l u e ( )
Returns a string with the value of the named property. If the named property does not exist, 
returns undefined. MediaRich includes two properties files that specify various system 
settings. The files are: local.properties and global.properties. Using the 
getPropertyValue()
 function, you can access these files from within a MediaScript.
NOTE: 
Properties are controlled by the MediaRich system administrator using the Admin Center. 
See MediaRich Administrator’s Guide for more information.
Syntax
getPropertyValue(
<"property name">
);
Parameters
Enter the property name in quotes. Property names consist of the filename in which the 
property exists (excluding the extension), a “.”, and then the actual property name. 
NOTE: 
Property name information is case-sensitive.
Example
To access the LogLevel property in the local.properties files:
getPropertyValue("local.LogLevel");
The local.properties file includes the following line:
LogLevel=error
So, getPropertyValue() returns “error”.