Invoke Verb from script

creasysee
Hello all.

I've a custom a JS function "showDialog" from external JS file:

JS code:

function showDialog(caption, text) {
//there show popup alert
...
ASLEvent("SendDialogResult", res);
}


Function assigned to Verb "touch".

ASLX code:

<object name="object1">
<inherit name="editor_object" />
<displayverbs>touch; aftertouch</displayverbs>
....
<touch type="script">
request (RunScript, "showDialog('" + object1.alias + "','there my text')")
</touch>
<aftertouch type="script">
if (DialogResult.value > 0) {
SetObjectFlagOn (object1, "answered")
}
</aftertouch>
</object>
...
<object name="DialogResult">
....
<value type="int">0</value>
</object>
...
<function name="SendDialogResult" parameters="data">
DialogResult.value = data
***** what there invoke Verb "aftertouch" of object "object1"? ****
</function>


After calling this function popup javascript alert displayed and waiting user action. After closing dialog by user js code from function showDialog calls function ASLEvent and function SendDialogResult has been invoked. Next I want to simulate the verb "aftertouch" of the object "object1". How can this be done?

Thanks.

Pertex
You could try
HandleSingleCommand ("aftertouch object1")


But I think you could move this aftertouch script into the function SendDialogResult,too

creasysee
Thanks, it works for me, but instead object name I use object alias:


<object name="object1">
<inherit name="editor_object" />
<alias>object1_alias</alias>
<displayverbs>touch; aftertouch</displayverbs>
....



HandleSingleCommand ("aftertouch object1_alias")


If I use "aftertouch object1" I have exception "UnresolvedObject" and otput text "I can't see that." Using an alias works correctly.
Maybe it's some my bug... Although if searching by the alias works then the object is valid and searching by name shoud works also. This is strange.

This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums