bonjour(
SERVICE
)

The bonjour( function returns a list of available hosts.


Parameters

This function has one parameter:

service – specifies the type of host you want to list, for example _printer._tcp for LPR printers over TCP. (You must already have started monitoring this service using the startbonjour statement.)


Description

This function returns a list of available hosts. Before using this function, you need to start monitoring the service type using the startbonjour statement. This function returns a carriage return delimited text array, with one host per line. Each line is a tab delimited text array, with the first element being the host name. The second element (after the tab) is the URL for host (including the port). Note that this URL is normally a local machine identifier, for example Bobs-MacBook-Pro.local.:8080, rather than an IP address. You can use this identifier in functions like url( and urltask(. By using an identifier instead of an actual IP address, the address will continue to work even if the underlying host IP address changes (for example due to DHCP).

For example, suppose you start monitoring TCP/IP printers on your network like this:

startbonjour "_printer._tcp"

Once you do that, you can get a list of TCP/IP printers with this formula.

arrayfilter(bonjour("_printer._tcp"),cr(),{tabarray(import(),1)})

Advanced Note: You can also use the bonjour( function to get a list of services that are currently being monitored. To do this, simply use the function without any parameters. If there are no parameters, it will return a carriage return delimited text array with the names of the services that are currently being monitored. For example:

startbonjour "_printer._tcp"
startbonjour "_http._tcp"
message replace(bonjour(),cr(),", ") ☞ _printer._tcp, _http._tcp

See Also


History

VersionStatusNotes
10.0NewNew in this version.