You would need to develop a utility able to write messages to a queue and read messages from a queue. This can be done using EMS Java API. Then this utility would be called from your script.
A good starting point would be to look at the samples provided with the product in the <TIBCO_HOME>/ems/8.6/samples/java directory (look at tibjmsMsgConsumer.java and tibjmsMsgProducer.java).
You would need to develop a utility able to write messages to a queue and read messages from a queue. This can be done using EMS Java API. Then this utility would be called from your script.
A good starting point would be to look at the samples provided with the product in the <TIBCO_HOME>/ems/8.6/samples/java directory (look at tibjmsMsgConsumer.java and tibjmsMsgProducer.java).