I just got a secondary monitor to use with my MacBook Pro (13" Retina Early-2015). I previously had AppleScripts for dimming and for increasing the brightness of the MBP screen—either to no bars or to about 75%—but now they aren't working for some reason (w/ or w/o the external monitor plugged in). I also tried using Shades but both screens keep flashing every 2-3 seconds (I'd rather use an AppleScript as well).
Basically, my external monitor is my main screen and I want to be able to dim my MBP screen using an AppleScript to either no bars or about 75% (of which the scripts will then be redirected to keyboard shortcuts with an application).
What AppleScript code would be needed to do this?
EDIT: Here is the old that worked really well before, but for some reason stopped (with out without an external monitor plugged in).
tell application "System Events" repeat 16 times key code 107 end repeat end tell
tell application "System Events" repeat 11 times key code 113 end repeat end tell