Set targetFolder to POSIX file "/System/Library/Speech/Voices/Allison.SpeechVoice" # find and set good English voice from installed voices Osascript "Extras/download new voice(s).scpt" ![]() Read -r -p "Continuing in 3 seconds." -t 3 -n 1 -s Launchctl kickstart -kp gui/501/SleepOnLowBatterySoundĮcho "Now I recommend you download the pleasant Allision onto your Mac :)" # If you pass -kp to the kickstart action, it will kill any running instance and restart it, then print out the PID of the new instance Launchctl enable gui/501/SleepOnLowBatterySound #launchctl load ~/Library/LaunchAgents/ist Sudo chmod +rx /etc/SleepOnLowBatterySound.scptĬhown -R $(whoami) ~/Library/LaunchAgents/Ĭhmod 755 ~/Library/LaunchAgents/ist If test ! -d ~/Library/LaunchAgents then mkdir ~/Library/LaunchAgents fiĬp -R InstallerData/ist ~/Library/LaunchAgents Sudo cp -R InstallerData/SleepOnLowBatterySound.scpt /etc If test -e $SoundPlist then launchctl stop SleepOnLowBatterySound & launchctl unload $SoundPlist & rm -R $SoundPlist fi If test -e $Plist then launchctl stop SleepOnLowBattery & launchctl unload $Plist & rm -R $Plist fi SoundScript="/etc/SleepOnLowBatterySound.scpt" One possibility might be a Perl approach, if someone volunteers. This is currently neither possible with an Apple Script nor with an Apple Script Bundle file, only with the script compiled into an app. Purely cosmetic: find a way to have the display notification in the top right of the screen not display the Script Editor icon but the one of the utility without turning the utility into an app but by maintaining a script to keep the load footprint low.Have the sound version install script check if Allison is installed, and if not, offer to download and install it.NEW: Sound script uses voice Allison if installed, otherwise automatically defaults back to another English standard voice (Daniel, Alex or Fred).NEW: added Catalina compatibility to install scripts verified Mojave compatibility.IMPROVEMENT: made queries of MaxCapacity and CurrentCapacity more compatible to work with hopefully any system.scpt files (SleepOnLowBattery.scpt, SleepOnLowBatterySound.scpt, demo.scpt) to restore functionality BUG FIX: changed all occurrences of ExternalChargeCapable to ExternalConnected in all Apple Script.IMPROVEMENT: Script is now compatible with both, ACPIBatteryManager.kext and SMCBatteryManager.kext.IMPROVEMENT: added macOS 10.14+ compatibility for download new voice(s).scpt.IMPROVEMENT: in ‘with sound/Install SOLB’ script, switched launchctl action from load to enable and from start to kickstart as per Apple’s recommendations for current versions of macOS.BUG FIX: button (to prevent sleep) had stopped working in macOS 10.15+.In case of a bug, always include your version of macOS for me or others to try and help. ![]() If you have ideas, experience bugs, etc., please contribute as precise, succinct, productive and friendly as possible. Please feedback if this utility also works for you. Tested working in macOS Monterey 12.0.1 and Catalina 10.15.7. download any language voice and translate the text inside the scriptĮdit with Apple Script Editor, save, install, reboot. download any other English voice of your liking and edit the name inside the script at the very top ![]() Regarding the sound version, you can also: The script should be active right away without restart. Run your desired mand, with or without sound. The launcher is installed per user, so one user can use the script with and another user the script without sound. If you want to see/ see and listen first, disconnect your Mac from its power supply and double click the “run Demo” file in either folder, with or without sound. If the lady is not installed, you can download "her" via System Preferences, Accessibility, Speech (pane tab should get opened by the install script), click onto the two arrows to the right of System Voice, Customize, English (Unites States) - Female, activate Allison, OK (macOS downloads voices to /System/Library/Speech/Voices - Allison consumes 120 MB). The version with sound uses the pleasant macOS US female voice Allison. Which you can cancel, or have your your *ac*Book be sent to sleep when down to 0. Building a CustoMac Hackintosh: Buyer's Guide
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |