gre.send_event

gre.send_event(
    event_name,
    [channel]
)
            

Send an event to the application or to a Storyboard IO channel.  channel is an optional parameter and if channel is not passed then the channel will be chosen as follows:

If the environment variable GREIONAME is set then it will be used otherwise the default channel is used.


Parameters:

        event_name    A string containing the event to send
        channel       An optional Storyboard IO channel to send the event on, if not specified the
                      event is added directly into the current Storyboard application event queue
                      if neither the environment variable or global GREIONAME variable are set.
Returns:

        true for success, false for failure and error message string, e.g. "Can't open greio channel my_channel" 

Example:
            

-- Send to the event  to the application :
local success, error = gre.send_event("my_event")
if(success == false) then
    print(error)
    --handle error
end


--To send the event to a Storyboard IO channel via parameters:
local success, error = gre.send_event("my_event", “io_channel_name”)
if(success == false) then
    print(error)
    --handle error
end