AppleScript can't enable Network Link Conditioner

I have apple script which opens Network Link Conditioner pane from System Preferences app and then toggles the switch to enable/disable it. Visually, everything works as expected. However, I can't see Network Link Conditioner icon in menu bar which tells me that it hasn't started. Is there something else should be done to activate Network Link Conditioner?


property thePane : "com.apple.Network-Link-Conditioner"
tell application "System Preferences"
activate
  set the current pane to pane id thePane
--delay 1
end tell
---
tell application "System Events"
  tell application process "System Preferences"
  try
  click ((checkboxes of window "Network Link Conditioner") whose description is "enable switch")
  on error
  click ((checkboxes of window "Network Link Conditioner") whose description is "enable switch")
  end try
  end tell
endtell

Hi Peeton,


I don't have that PrefPane installed, so I can't test your script. Two small things I notice (that may well not be significant 🙂) are that there's a space missing between end and tell in the last line, and that on error might as well be given an extra delay 1 or so to give it more of a second chance than running the same command immediately after it has failed once...


Max.

I'm somewhat of a NuBee to the Developer Frums.

I've an interest in having Network Link Conditioner load at start up vs having to turn it on.

Could you please send me a Step by Step on a how to "Get er done!"

ranger95@mac.hush.com

AppleScript can't enable Network Link Conditioner
 
 
Q