1 #!/usr/local/bin/wish8.5
3 # Usage: xc_remote <filename>
5 # This script attempts to communicate with an existing xcircuit
6 # application. If none exists, it starts a new xcircuit process.
7 # If one exists, then it forces xcircuit to create a new window,
8 # and the file <filename> is loaded into it as a new page.
11 foreach
host [lrange
[split [exec xhost
] \n] 1 end
] {
14 set appname
"tkcon.tcl #2"
15 if {[catch
{send
$appname xcircuit
::forkwindow
}]} {
16 exec xcircuit
[lindex
$argv 0] &
18 send
$appname {config focus
[lindex
[config windownames
] 0]}
19 set npages
[send
$appname page links total
]
21 send
$appname page
$npages goto
-force
22 send
$appname page load
[lindex
$argv 0]