Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

mejiasa01

macrumors newbie
Original poster
Hi all,

Please excuse my lack of knowledge but here it goes, basically, like all of us still working from home, and while I get distracted on the work I usually end up drying my MAC battery to almost 1%. So I found the following script online but I keep getting the "Syntax Error: Expected end of line" with the "else"

set Cap to (do shell script "ioreg -w0 -l | grep ExternalChargeCapable") tell Cap to set {wallPower} to {last word of paragraph 1} if wallPower = "Yes" then return 0 else set Cap to (do shell script "ioreg -wO -l | grep Capacity") tell Cap to set {Available, Max} to {last word of paragraph 2, last word of paragraph 1} set Pct to round (100 * Available / Max) if Pct <= 4 then tell application "iTunes" pause end tell set volume 100 do shell script "say -v \"Zarvox\" \"LOW BATTERY\" " if Pct <= 3 then beep 5 do shell script "say -v \"Zarvox\" \"PLUG ME IN NOW\"" end if end if end if

Basically what this will do is play an annoying sound when I'm low on battery and I will get off my ass and look for the charger.
Link: https://lifehacker.com/give-your-mac-a-more-attention-grabbing-low-battery-w-5769174

1606223460381.png
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.