edit: I stole-ahem-borrowed the coding for my dialog box from someone (i forgot who, sorry). I dont know how to edit it so that it doesnt sleep - the person i borrowed it from used it as a sleep confirmation button - so i just changed the delay to 1000 so it'll never sleep.
just letting anyone who wants to know, know.
thanks
add with title "your title" after a space in the line.
Regarding the trigger when battery reaches 10%, there have been discussion so recently doing that using shell scripts. Just do quick search and you'd find it.
Hi @rishifter
where exactly do you mean? I couldnt get it working.. can you put it in the code and send it to me so that I can copy and paste it?
Thanks very much.
haha. I made that 'Battery Triggered Button' topic, for my touchbar. I've already tried copying the code, putting the code for this in.. etc. I have no idea how to do it tho.
set powersource to word 4 of paragraph 1 of (do shell script "pmset -g batt")
if powersource is "AC" then
return ""
else
set batteryPercent to word 6 of paragraph 2 of (do shell script "pmset -g batt")
if batteryPercent is "100" then
return ""
else if batteryPercent is less than "11" then
tell application "BetterTouchTool"
execute_assigned_actions_for_trigger "1F9B1FAB-8AA0-4005-B330-FE5E6B8FA6A0"
end tell
set remainingminutes to word 9 of paragraph 2 of (do shell script "pmset -g batt")
return "Warning: " & batteryPercent & "% Remaining. Please charge MacBook. " & remainingminutes & " minutes until lockdown."
else
return ""
end if
end if
Where you have this line in the code, duplicate it. And in the second one add the UUID of the named trigger you created before for bringing up the dialog. Then it will both send a haptic feedback to vibrate and also show you the dialog.
To share code like this you can use shortcut CMD+Shift+C when posting something here.