As far as I can tell, the instructions for the createPopupMenu are wrong. If you try to use selectedAlarmEvents it works fine. However, if you try to use alarmEvent.get() it creates an error ‘alarmEvent undefined’. This is unlike the double click script which works perfectly.
I am using 7.7.5
Can you show a snippet of the script where you get that error?
Sure. Simple script:
target = selectedAlarmEvents
print target
name = alarmEvent.get('name')
print name
error:
[quote][Event[name=Condensate flow low low alarm, source=prov:default:/tag:CP2B/FIT102/LL_Al:/alm:Condensate flow low low alarm, priority=High, desc=null]]
ERROR [StatusChart-AWT-EventQueue-2] Error invoking extension method.
Traceback (most recent call last):
File “”, line 17, in createPopupMenu
NameError: global name ‘alarmEvent’ is not defined[/quote]
Try something like this:
target = selectedAlarmEvents
print target
for alarmEvent in selectedAlarmEvents:
name = alarmEvent.get('name')
print name
More than one alarm event could be selected, so selectedAlarmEvents is a collection of all the ones selected. To get the properties of a single selected alarm event (even if only one is selected), you need to access a single member of the collection.
Perfect.
Thank you for clarifying. I wish these scripts had a little more documentation. I guess that is what we are doing here.