Page 1 of 1

Help with old Applescripts

PostPosted: Tue Oct 15, 2019 5:26 pm
by cmfulmer
I'm trying to get a few pair of light switches to sync device state. Here's the applescripts I have:
trigger "Garage Master", action #1: execute embedded AppleScript "set on state of device "Garage Slave" to on state of device "Garage"..."
trigger "Garage Slave", action #1: execute embedded AppleScript "set on state of device "Garage" to on state of device "Garage Slave"..."
trigger "Side Flood Lights Master", action #1: execute embedded AppleScript "set on state of device "Side Flood Lights Slave" to on state of device "Side Flood Lights"..."
trigger "Side Flood Lights Slave", action #1: execute embedded AppleScript "set on state of device "Side Flood Lights" to on state of device "Side Flood Lights Slave"..."
trigger "Garage Eve Master", action #1: execute embedded AppleScript "set on state of device "Garage Eve Slave" to on state of device "Garage Eve"..."
trigger "Garage Eve Slave", action #1: execute embedded AppleScript "set on state of device "Garage Eve" to on state of device "Garage Eve Slave"..."
trigger "Curtain Outlet", action #1: execute embedded AppleScript "turn off "Curtains" in 10..."
trigger "Basement Master", action #1: execute embedded AppleScript "set on state of device "Basement Slave" to on state of device "Basement"..."
trigger "Basement Slave", action #1: execute embedded AppleScript "set on state of device "Basement" to on state of device "Basement Slave"..."
trigger "Stairs", action #1: execute embedded AppleScript "set on state of device "Stairs Master" to on state of device "Stairs"..."
trigger "Stairs Master", action #1: execute embedded AppleScript "set on state of device "Stairs" to on state of device "Stairs Master"..."

Can I do this directly through the 'triggers' pane now, or do I need to convert to Python?

Thanks,
Chad

Re: Help with old Applescripts

PostPosted: Tue Oct 15, 2019 7:31 pm
by FlyingDiver
There's a "Match On State of Device" action available now which does what you want.

Re: Help with old Applescripts

PostPosted: Wed Oct 16, 2019 9:43 am
by jay (support)
FlyingDiver wrote:
There's a "Match On State of Device" action available now which does what you want.


+1. This should greatly simplify your triggers... ;)

[MODERATOR NOTE] moved to appropriate forum.

Re: Help with old Applescripts

PostPosted: Wed Oct 16, 2019 4:25 pm
by cmfulmer
I saw that when I was looking it over, and wasn't sure if that was the way to go or not. Thanks!