Trying to add time and battery level to Keyboard Commander

By Catherine, 24 May, 2014

Forum
macOS and Mac Apps

Adding 2 letters to keyboard commander: t for time & date, b for battery level. Not currently there. Hoping there is a shortcut key I can activate. I have looked at the keyboard commander & the selections from general to custom; nothing seems to fit what I'm trying to do. Suggestions much appreciated.

Options

Comments

By mehgcap on Tuesday, May 27, 2014 - 04:30

Try this set of scripts. I wrote these scripts last year. The ram info one doesn't work under Mavericks, but the rest should. Simply follow the instructions in the Readme file to set things up, and assign any scripts you want to any commanders you want.

By Tristan on Tuesday, May 27, 2014 - 04:30

Wow, thanks for posting this. Many of them appear to be useful -- I just set up the battery and CPU ones already.
Great work.

By Ivor123 on Tuesday, May 27, 2014 - 04:30

Mehgcap, Thank you for sharing these scripts with us. I'm especially excited to finally be able to find out the status of my battery with the press of a keystroke. On a related note, could you suggest some resources for someone interested in learning Apple script, but who has no programming background. Thanks again for the scripts.

By mehgcap on Tuesday, May 27, 2014 - 04:30

Honestly, I just learned everything from Google. I don't usually point people toward a search engine in answer to a request for resources, but in this case it is your best bet. I believe Bookshare has some books on the topic as well.

Applescript is not a complex programming language at all, and is designed to be as close to human speech as it can be. For example:
set x to 5
set searchString to "this is some text"
tell application "Mail"
set messageList to all messages whose contents contain theSearchString
display dialog "Found "&(messageList count)&" messages containing "&searchString&"."
end tell

By Catherine on Tuesday, May 27, 2014 - 04:30

In reply to by mehgcap

I should have mentioned that mac air & VO is newish to me. I had trouble opening the script link, but using vo l then click on downloads I found dashboard 1 to 25. Not sure what to do here or if this is where I'm supposed to be looking, but did not find a read me file. Possible for more details? Much to learn!

By mehgcap on Tuesday, May 27, 2014 - 04:30

I'm not sure what you mean by "1 to 25". Try this:

  1. Download the file. It will appear in your Downloads folder, so go to Finder, press command-option-l, and arrow to the file.
  2. Command-o on the file. It will unzip and give you a folder of files. The Readme file will be one of them, along with a bunch of .scpt (AppleScript) files.
  3. When you are assigning your commanders, and you choose to "run AppleScript script" as the action, browse to this folder and choose the script you want. You may move the folder anywhere, so long as all the files therein stay together.

By KE7ZUM on Tuesday, May 27, 2014 - 04:30

In reply to by mehgcap

I would add a step to that. copy the folder to ~/library/scripts since this is the first place any app looks for scripts

By dvdmth on Tuesday, May 27, 2014 - 04:30

In VoiceOver Utility, when you choose the option for AppleScript in the commander settings, the file browser defaults to the system level directory, /Library/Scripts, not the user level directory, ~/Library/Scripts. The read me suggests putting the scripts in that folder because it's where VO Utility defaults to. Note that you need administrator access to put anything into /Library/Scripts, and you will likely need to enter your login password when making the move.

As the read me says, though, it doesn't really matter where you keep the files. Having them in /Library/Scripts only makes it more convenient when configuring the commanders in VO Utility.

Incidentally, thanks for the link to these scripts. I wasn't looking for this, but I think I might find these scripts useful.

By Catherine on Tuesday, May 27, 2014 - 04:30

I was expecting the download to open, so I have several copies of talking dashboard. Have read the read me file with some understanding. Not sure how to save it to library/scripts or where that is located. Q, for time only command option T & for date only command option tt (that is right option held down with letter keys)? Being a novice I find the key strokes used to do an action useful info. Thanks for all input.

By KE7ZUM on Tuesday, May 27, 2014 - 04:30

Copying the script files is easy. Just

1 copy the files with cmd c. You can hit cmd a to copy them all, or just copy the folder. 2 Navigite to yrou library with cmd h, then start typign library and hit cmd down arrow. 3 Navigate to the scripts folder and paste the folder in there.

Good luck.

By mehgcap on Tuesday, May 27, 2014 - 04:30

The library folder is hidden by default, so you won't find it in your home directory. This is why I didn't mention it; it is far easier to navigate to where you put the scripts when assigning the commander than it is to try to hunt down the proper library folder, especially for a new user. You can simply put the folder of scripts wherever you like, then go to that folder when you are assigning the commander and choose the script you want.

Yeah I unhid it with cmd j and then checking the appropaite box. Besides igt's just easeier to type

~/library/scripts

from gthe go comand cmd g. I was doing that when I first got my mac. lol!

By Chris Norman on Friday, June 27, 2014 - 04:30

Hi,
You can also use an apple script to run a shell script which contains the following line (works faster for me):

pmset -g batt | say -r 500

The command I cannot take credit for, after reading this post, I realised getting battery status was on my list of things to do, so I hit up google before reading any replies (I'm a sucker for shell scripting), and found that on another site (thank you to the original author).

Cheers, and hope you got your battery status already.