When we create a simple web page and read this line with NVDA shortcut key H it will be read as "Flash Sale heading level three"
<h3 class="hp-mod-card-title">Flash Sale</h3>
But is there a way to assign this Flash Sale to a python variable?. Really sorry I'm bit new to this.
import globalPluginHandler
import ui
class GlobalPlugin(globalPluginHandler.GlobalPlugin):
def script_sayHeader(self, gesture):
x = "Header 123"
ui.message(x + 'is a nice header')
__gestures={
"kb:h":"sayHeader"
}
This is the code for a global plugin I created and I need to add a current header or shortcut key value to this x. This is a sample code and what I intend to do is a bit complicated.
I tried adding this too but still showing only page title all the time :(
import globalPluginHandler
import ui
import api #added this
class GlobalPlugin(globalPluginHandler.GlobalPlugin):
def script_sayHeader(self, gesture):
x = api.getNavigatorObject().name #added this
ui.message(x + 'is a nice header')
__gestures={
"kb:h":"sayHeader"
}