Applescript control broken in 1.7.6b1

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

szymon_k

Posts: 1
Joined: Thu Nov 16, 2017 2:34 am

Post by szymon_k » Thu Nov 16, 2017 2:36 am
this (below) used to work, now it doesn't? getting: "Viscosity got an error: AppleEvent handler failed."
Code: Select all
tell application "Viscosity"
	set connectionNames to connections
	set connectedName to ""
	
	repeat with theConnection in connections
		set theState to state of theConnection
		if theState is "connected" then set connectedName to name of theConnection
	end repeat
	
	return connectedName
end tell

James

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

Post by James » Thu Nov 16, 2017 6:17 pm
Hi szymon_k,

Thanks for the bug report - much appreciated! I can confirm we're seeing the same behaviour (looks like it was an issue that was caused by the move from Swift 3 to Swift 4), and it should now be fixed in the latest beta version released today.

Also, you can shorten your script down to just the following :)
Code: Select all
tell application "Viscosity" to return name of first connection whose state is "connected"
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