Script Plugin

Description

AMSWScript is an action plugin that with this you can execute vbs and js file from AMS.

Actions

Script.AddCode
Script.GetResultAsDate
Script.GetResultAsDouble
Script.GetResultAsFloat
Script.GetResultAsLong
Script.GetResultAsWord
Script.GetResultAsByte
Script.GetResultAsString
Script.GetResultAsQuad
Script.Reset
Script.SetLanguage
Script.SetTimeOut
Script.GetTimeOut
Script.FormatDate

Script.AddCode(string Script, number Type);

Description:

Add Code and execute it.

Script:

(string) Codes.

Type:

(string) Type of your code (Internal or external).

Returns:

nothing

Example1:

code =[[
result = Date() + Time()
]]

Script.AddCode(code, Script_InternalCode);
date = Script.GetResultAsDate("result");
Dialog.Message("", Script.FormatDate(date, "%yyyy.%mm.%dd %hh:%ii:%ss"))

Example2:

TextFile.WriteFromString("c:\\code.vbs", "result = Date() + Time()", false);
Script.AddCode("c:\code.vbs", Script_ExternalCode);
date = Script.GetResultAsDate("result");
Dialog.Message("", Script.FormatDate(date, "%yyyy.%mm.%dd %hh:%ii:%ss"))

Script.GetResultAsDate(string Varible);

Description:

Get result that beforehand executed in Script.AddCode as Date(number).

Varible:

(string) Name of variant that beforehand executed in Script.AddCode.

Returns:

(number) get value of Varible in Date format.

Example:

date = Script.GetResultAsDate("result");
Dialog.Message("", Script.FormatDate(date, "%yyyy.%mm.%dd %hh:%ii:%ss"))

Script.GetResultAsDouble(string Varible);

Description:

Get result that beforehand executed in Script.AddCode as Double(number).

Varible:

(string) Name of variant that beforehand executed in Script.AddCode.

Returns:

(number) get value of Varible in Double format.

Example:

doublevalue = Script.GetResultAsDouble("result");
Dialog.Message("", doublevalue)

Script.GetResultAsFloat(string Varible);

Description:

Get result that beforehand executed in Script.AddCode as Float(number).

Varible:

(string) Name of variant that beforehand executed in Script.AddCode.

Returns:

(number) get value of Varible in Float format.

Example:

floatvalue = Script.GetResultAsFloat("result");
Dialog.Message("", floatvalue)

Script.GetResultAsLong(string Varible);

Description:

Get result that beforehand executed in Script.AddCode as Long(number).

Varible:

(string) Name of variant that beforehand executed in Script.AddCode.

Returns:

(number) get value of Varible in Long format.

Example:

longvalue = Script.GetResultAsLong("result");
Dialog.Message("", longvalue)

Script.GetResultAsWord(string Varible);

Description:

Get result that beforehand executed in Script.AddCode as Word(number).

Varible:

(string) Name of variant that beforehand executed in Script.AddCode.

Returns:

(number) get value of Varible in Word format.

Example:

wordvalue = Script.GetResultAsWord("result");
Dialog.Message("", wordvalue)

Script.GetResultAsByte(string Varible);

Description:

Get result that beforehand executed in Script.AddCode as Byte(number).

Varible:

(string) Name of variant that beforehand executed in Script.AddCode.

Returns:

(number) get value of Varible in Byte format.

Example:

bytevalue = Script.GetResultAsByte("result");
Dialog.Message("", bytevalue)

Script.GetResultAsString(string Varible);

Description:

Get result that beforehand executed in Script.AddCode as String(string).

Varible:

(string) Name of variant that beforehand executed in Script.AddCode.

Returns:

(string) get value of Varible in String format.

Example:

stringvalue = Script.GetResultAsString("result");
Dialog.Message("", stringvalue)

Script.GetResultAsQuad(string Varible);

Description:

Get result that beforehand executed in Script.AddCode as quad(number), Quad used for very very huge number.

Varible:

(string) Name of variant that beforehand executed in Script.AddCode.

Returns:

(number) get value of Varible in Quad format.

Example:

quadvalue = Script.GetResultAsString("result");
Dialog.Message("", quadvalue)

Script.Reset();

Description:

Reset Script to default.

Returns:

nothing.

Example:

Script.Reset()

Script.SetLanguage(string Language);

Description:

Set Language (Default Language is VBScript).

Language:

(string) Language. (Script_VBScript and Script_JScript )

Returns:

nothing.

Example:

Script.SetLanguage(Script_VBScript)

Script.SetTimeOut(number Delay);

Description:

Set TimeOut.

Delay:

(number) Time in milisecond.

Returns:

nothing.

Example:

Script.SetTimeOut(10000)

Script.GetTimeOut();

Description:

Determine what value has TimeOut.

Returns:

(number) return timeout.

Example:

ms = Script.GetTimeOut()
Dialog.Message("", ms)

Script.FormatDate(number Date, string Mask);

Description:

Returns a string representation of the Date, according to the specified Mask.

Date:

(number) result of Script.GetResultAsDate.

Mask:

(string) The Mask parameter is a string which specifies how the date should be formatted.

Returns:

(string) Returns a string representation of the Date, according to the specified Mask.

Note:

%yyyy - Will be replaced by the year value
%yy - Will be replaced by the year value
%mm - Will be replaced by the month value
%dd - Will be replaced by the day value
%hh - Will be replaced by the hour value
%ii - Will be replaced by the minute value
%ss - Will be replaced by the second value

Example1:

date = Script.FormatDate(1222039911, "%yyyy.%mm.%dd %hh:%ii:%ss")
Dialog.Message("", date)

Example2:

date = Script.FormatDate(1222039911, "%hh:%ii:%ss")
Dialog.Message("", date)

Additional Information

Author:

AMSWaves Corporation
support@AMSWaves.com

Copyright:

Plugin is copyright © 2008-2008 AMSWaves Design Corporation.

Website:

http://www.AMSWaves.com


Copyright © 2008 AMSWaves Design Corporation.
All Rights Reserved.