Hi Pranav,
It just so happens that somebody else has been asking very similar
questions on the nvda-devel mailing list recently. Here's a reply from
one of NVDA's lead developers that might help.
The first thing to consider is why you're trying to directly call a--
script, as this determines the best way to do it. 1. If you're trying
to just emulate a key press from a user and you want NVDA to respond
as it always would (e.g. you want to pretend the user pressed up
arrow), use inputCore.manager.emulateGesture. Make the relevant
gesture using keyboardHandler.KeyboardInputGesture.fromName. 2. If
you want to call an NVDA specific command (e.g. you wanted to call
the date time command from another script for some reason), you
should be able to just execute the script and pass None for the
gesture; e.g.
scriptHandler.executeScript(globalCommands.commands.script_dateTime,
None). However, this isn't something you really should be doing
unless there is a very good reason.