Cannot access connection `serverAddress` property

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

passogba

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

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

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.

James

User avatar
Posts: 1865
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
Cheers,
James
James Bekkema
Viscosity Developer

Web: http://www.sparklabs.com
Support: http://www.sparklabs.com/support
Twitter: http://twitter.com/sparklabs
2 posts Page 1 of 1