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: 2313
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
Web: https://www.sparklabs.com
Support: https://www.sparklabs.com/support
Twitter: https://twitter.com/sparklabs
2 posts Page 1 of 1