Cannot access connection `serverAddress` property

Got a problem with Viscosity or need help? Ask here!


Posts: 1
Joined: Wed Nov 07, 2018 6:02 am

Post by passogba » Wed Nov 07, 2018 6:09 am

I am attempting to check my connection's address with the `serverAddress` property shown in the docs with the following command:
Code: Select all
set addr to serverAddress of connections where state is equal to "Connected"
return addr
This used to work, but now it returns an error:
Code: Select all
Can’t make serverAddress of every connection whose state = "Connected" into type specifier.
Is the serverAddress property no longer accessible?

Thanks in advance.


User avatar
Posts: 1912
Joined: Thu Sep 04, 2008 9:27 pm

Post by James » Wed Nov 07, 2018 10:06 am
Hi passogba,

It looks likely to be a syntax problem with your script: there could be multiple matching connections. Try something like so instead:
Code: Select all
tell application "Viscosity"
	set addr to serverAddress of first connection where state is equal to "Connected"
	display dialog addr
end tell
James Bekkema
Viscosity Developer

2 posts Page 1 of 1