#!/bin/bash

#©keithhedger Fri 7 Oct 11:22:22 BST 2016 kdhedger68713@gmail.com

KKEDIT=../../app/kkedit
KKMSG=../../app/kkeditmsg
INSTANCE=1234

#open instance or bring to front
($KKEDIT -i $INSTANCE) &
#tell instance to inform us after loading has finished
$KKMSG -k $INSTANCE -s "WaitForKKEdit" -a
#open files
$KKEDIT -i $INSTANCE /etc/fstab /etc/hosts
#wait for loading to finish and discard o/p ("continue")
$KKMSG -k $INSTANCE -W -r >/dev/null
#print list of open files
$KKMSG -k $INSTANCE -s "p" -a
#wait for 1st message then print all meassages to stdout
$KKMSG -k $INSTANCE -W -r
#
##wait for user ( click Navigation->Continue )
#$KKMSG -k $INSTANCE -s "W" -a
#$KKMSG -k $INSTANCE -w  >/dev/null
#
##print open files to stdout
#$KKMSG -k $INSTANCE -s "p" -a
##wait for 1st message then print all meassages to stdout
#$KKMSG -k $INSTANCE -W -r
#
#quit instance
#$KKMSG -k $INSTANCE -s "Q" -a

