Wednesday, October 7, 2009

Applescript Display Folder Actions Status and then Decide "ON" or "OFF"

I think this should be included with default Applescripts. It's not, so I used some skillz to make the source code for your Applescript. Hope it's useful.



tell application "System Events" to get folder actions enabled

if result is false then

set OnOff to button returned of (display dialog "Folder Actions is OFF" buttons {"Turn OFF", "Turn ON"})

else

set OnOff to button returned of (display dialog "Folder Actions is ON" buttons {"Turn OFF", "Turn ON"})

end if


if OnOff is equal to "Turn OFF" then

tell application "System Events" to set folder actions enabled to false

else

tell application "System Events" to set folder actions enabled to true

end if


No comments: