Hi James
any idea what is wrong with this
Quotevc.callAction("vc.SetEventTimer","7","Macro Arabic",List[str] (["SPAN","13","14"]))
the error message i get is (http://www.freesmileys.org/smileys/smiley-angry015.gif) (http://www.freesmileys.org/smileys.php)
104 Python Error:Microsoft.Scripting.ArgumentTypeException: callAction() takes exactly 3 arguments (4 given)
yes. you are using 4 parameters when you should only be using 3. I think the error message made that quite clear.
without seeing the whole code, I can't really suggest how to fix it though.
if you look in the wiki the call action method is described like this:
void callAction(string strActionType, string strParams, List<string> payloads);
I think the problem here is that you are sending your action parameters wrong. Try this
vc.callAction("vc.SetEventTimer","7&&Macro Arabic",List[str] (["SPAN","13","14"]))
Thanks James, will try it when I get home
hi James
the event is sent after 7 seconds but the payloads have a problem.
vc.callAction("vc.SetEventTimer","7&&Macro Arabic",List[str] (["SPAN","13","14"]))
error message: out of range exception value '0' is not valid for 'index' 'index should be between 0 and -1
this works fine
vc.triggerEvent("Macro Arabic", List[str] (["SPAN","13","14"]))
the action VC.SetEventTimer takes 2 or more parameters. You don't need to pass it payloads. the 3rd parameter will be used as payload1 when the event is fired.
In general most actions don't require you to use payloads at all, you only need to give it parameters. If the parameters themselves use the terminology {1} then a payload will be required so that the substitution can take place.
the actions that allow us to control VC from python are really just reusing existing methods that VC exposes to plugins, so not everything will appear to make sense at first. ;)
so you should call it like this (the SetEventTimer action is getting sent 5 parameters):
VC.callAction("VC.SetEventTimer","7&&Macro Arabic&&SPAN&&13&&14",None)
If you wanted to pass in the list of payloads for some reason you could also write:
from System.Collections.Generic import *
vc.callAction("vc.SetEventTimer","2&&Macro Arabic&&{1}&&{2}&&{3}",List[str] (["SPAN","13","14"]))
but I thought the whole point of using python was because you did want to use VC.SetEventTimer !?!?
hmmm that import got me thinking. Here is something else to think about...
import clr
clr.AddReference("System.Windows.Forms")
from System.Windows.Forms import *
MessageBox.Show("I am a message box!","Ta DA!!!")
hola
VC.callAction("VC.SetEventTimer","7&&Macro Arabic&&SPAN&&13&&14",None)
does not work(http://www.freesmileys.org/smileys/smiley-angry015.gif) (http://www.freesmileys.org/smileys.php) but if i change VC.callAction to vc.callAction it does work.
thank you so much.
:biglaugh
Right. Sorry about that. Bloody case sensitivity! I tested with lower case but then changed it trying to improve the readability of my post. VC actions are not case sensitive, because I specifically wrote code that would ignore case, but in this case python is accessing an object defined in c#, and so it is case sensitive. Good catch.