appears as a red button on the Touch Bar, acts as a toggle.
Not sure what "the KM Macro AppleScript" refers to, and not sure how that could reduce KM shortcuts by 90% (the space on the Touch Bar is quite limited).
I shouldn't try speak for another person (that won't stop me from trying) but I think when he said "KM Macro AppleScript" he probably meant "the KM action Execute AppleScript", ie,
I'm not sure how he concludes that we can reduce shortcuts by 90%. Perhaps he meant if we code things in Applescirpt we can reduce our code in KM proportionately. Sure. If you eat more Apples (AppleScript) you can eat fewer Kiwis (Keyboard Maestro). But you still need to eat the same amount of fruit.
Hi @jipnet and @Sleepy, at the beginning I also assigned shortcuts in KM and then used them in BTT to set up a touch gesture.
Since this has led to overlaps with the shortcuts over time, I also changed the use of the AppleScripts included in the macros. I now use it in BTT and save myself the trouble of working with random shortcuts
I had a post here once about it:
In my post I explain how to create BTT gestures with the mouse or trackpad. You @jipnet must select then in the BTT menu only the carrier for the Touch bar.
If you want to launch the master macro (Toggle Internet) from BTT, then just use the same method you are already using for launching the two sub macros from the master macro: via AppleScript.
You find the the premade AppleScript to launch your master macro in the “Or by AppleScript” popup:
Then you paste that script to BTT here:
…and set the BTT trigger you want.
BTW, to launch the sub macros from your master macro, you can also make use of the Execute Macro action:
It is made for such cases, so no need to use an AppleScript action here.
Hello @Tom, if you are interested, I have a macro with which you can save yourself the manual copy & paste of the AppleScript between KM and BTT.
In KM your macro manners (blue) and trigger the macro. If you have selected the AppleScript action in BTT, simply press the Space key and the AppleScript will be inserted.
Thanks Tom. There are obviously many ways to achieve the same goal.
I just noticed that the flaw with this method (and any proposed so far) is that to toggle both on or off, both must be in the same initial state (either on or off). Otherwise, one will go on and the other off. In other words, the solution is really "analogue" and not fully "digital." (no doubt due to the scripts that do the toggling, which I found on the web ready made)
THanks. I will explore these tips in due time. Right now I have a fat red button on my control strip that performs the combined action as scripted in KM, making it a snap to turn on or off the WiFi and BT. (I read that thieves can "sniff" BT and WiFi signals in a laptop in a car, so I want to deprive them of this opportunity in as mindless a way as I can remember.)
I haven't played with BTT folders, but I imagine you can drill down several levels without leaving the keyboard. But at some point, a floating palette might be simpler (alas, not so useful in a laptop format where screen real estate is limited—though your disappearing palette may take care of that too)
Well, good catch, but that can be fixed by an IF statement, such as "If Wireless Network BELL101 is connected then DISABLE both networks else ENABLE both networks." That's probably an improvement. But some people might prefer toggling both, which can be done with two IF statements.
I know, you are a big fan of chained GUI actions (clicking buttons, selecting menu items, …). Me not so much
What about this:
Not completely “automized”, but dead simple.
If you really want to create dedicated LB actions to launch KM macros, then I would simply duplicate an existing one (in Action Editor, right-click on an action), adapt the name and paste the UUID into the script.
Once again, not automized. But not much gain by “automizing” it. Especially not when automizing it with a fragile GUI macro. (I know, Action Editor is not scriptable, but there isn’t much reason to make it scriptable.)
Hi @jipnet, thanks for posting these. When you have a moment, would you mind editing your post to include screenshots of the macros? I’m asking for me, but it’s also a good rule of thumb to do this whenever posting a macro: it’s really helpful for others to be able preview what they’ll be downloading, or even save them the effort if they can see from a visual that it’s not what they were looking for.
[ If you want to be super duper, then you can also copy any scripting code used in any macros you upload, and include them as formatted code blocks under the screenshots, but this is less important. It can, however, benefit you should someone skim a post and notice something that wouldn’t have been caught otherwise. ]
Done. But I don't know how to make formatted code blocks unless it's by using three ``` before and after as above (after searching for this formatting command)
Indenting a line with 4 (or more) spaces will turn that line into a code snippet that spans the width of the post. Subsequent lines that are either blank or indented 4 (or more) spaces will be added and merged to form a code block. The block ends with the last, non-blank, indented line.
When typing a post, the editing area has a toolbar:
If you select a block of text first, then click the button shown, it indents every line by 4 spaces, thus creating a code block.
The simplest way, I find, is, as you found, by opening and terminating a block of text using three backticks, ```. The opening set can, optionally, specify the language that is used to help highlight its syntax appropriately, e.g.:
The language identifier is often not needed as it's typically detected automatically. But common identifiers include: applescript, javascript, html, shell. Your code blocks suffered the annoying consequence of having the browser attempt to paste the code with the formatting style information that was copied along with the text itself. I forget how to avoid this from happening.
Found it: you copy the code in KBM not by command-C but by the "copy" command in the gear that controls the code entry in the macro. And the ``` before and after. tx
Some laptops come with “Wi-Fi” function keys or switches that can quickly enable or disable your Wi-Fi. If your PC doesn’t have one of these, though, you can make one with the tools built into Windows.
You’ll need to start by creating a desktop or start menu shortcut. Once you’ve done that, you can invoke it with a keyboard shortcut, if you like. shareit apk