GoldenChaos-BTT Support and Feedback Thread

@Eloquente not sure, maybe @Andreas_Hegenberg knows.

Speaking of @Andreas_Hegenberg - how can I convert all these empty script widgets to buttons without changing their style properties and UUID's? That and the Microphone Mute bug are all that remains before the next stable version is ready. I'd love to release it tomorrow as v2.641! :slight_smile:

If you could do it faster and would be willing I can send you my current snapshot (made a few minor changes since yesterday).

1 Like

I missed your comment about Trello! This is actually because Fantastical and Trello use the same keyboard shortcut by default. Personally, I disabled the keyboard shortcut in Trello since I never use it, and they have a handy option to turn it off in the app preferences.

1 Like

I figured that this might be the reason - I disabled the shortcut in Trello as well :slight_smile:

Where is the function getTimeInHoursAndMinutes24Hour() defined?
I would like to change the 24-hour format with a dot (.) as a separator, like: 19.24

But manually changing the appearance of the Date / Time widget gets overwritten every time I collapse the menu bar.

To convert many items in a preset I'd recommend to install NodeJS because it makes it very easy to work with json files (like the BTT Presets).
This little script would convert all Apple Script widgets that just have return " " in them, to buttons (see attachment).

To use the script:
1.) Install NodeJS, easiest via NVM
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
then
nvm install v8.12

2.) Save the script to some location on your disk, then open a terminal at that location.
3.) To start the script just type node convert-preset.js

The script currently assumes a file called "GoldenChaos-BTT 2.639-2.bttpreset" in the same folder as the script.

convert-preset.zip (833 Bytes)

Script as Text
var fs = require('fs');

//read the preset json (uncompressed only)
var presetContentString = fs.readFileSync(
  './GoldenChaos-BTT 2.639-2.bttpreset'
);

var presetJSON = JSON.parse(presetContentString);
var numberOfConverted = 0;

function parseTriggers(triggers) {
  for (let presetTrigger of triggers) {
    // here we can now modify the trigger.
    // first check if the trigger has an apple script string
    if (
      presetTrigger['BTTTriggerConfig'] &&
      presetTrigger['BTTTriggerConfig']['BTTTouchBarAppleScriptString']
    ) {
      // check if the apple script contains return " "
      if (
        presetTrigger['BTTTriggerConfig'][
          'BTTTouchBarAppleScriptString'
        ] == 'return " "'
      ) {

        // THIS IS THE IMPORTANT PART:
        // change the type of the trigger to a button:
        presetTrigger['BTTTriggerType'] = 629; //629 is the type of a touchbar button
        delete presetTrigger['BTTTriggerConfig']['BTTTouchBarAppleScriptString'];
        numberOfConverted++;
    }

     
    }
     // for groups we need to look at the child items:
     if (presetTrigger['BTTAdditionalActions']) {
      parseTriggers(presetTrigger['BTTAdditionalActions']);
    }
  }
}

console.log('start...');
for (let presetApp of presetJSON['BTTPresetContent']) {
  console.log('looking at triggers for app:', presetApp['BTTAppName']);
  parseTriggers(presetApp['BTTTriggers']);
}

// save the edited json:
fs.writeFile('convertedPreset.bttpreset', JSON.stringify(presetJSON), 'utf8', () => {
  console.log('finished converting and saved to convertedPreset.bttpreset! Converted:', numberOfConverted, 'items.');
});

I think this could also be useful for other changes in the future.

This is the result when I ran it on the preset:
convertedPreset.bttpreset (22.0 MB)

1 Like

Hi @GoldenChaos - fabulous work on this! I'm really enjoying the presets and learning a lot about how to configure things on the touchbar. Not using all the presets for my workflow, but benefitting from your setup of group open/close etc. I've changed some of the 'close group' buttons to be on the right if they open via a right-hand button (keep same hand in motion, better for my interaction), and various other small things like that.

Incidentally, I like the wifi on/off button since I work in many places without internet, but I have an issue with the touchbar and my computer freezing/lagging when I disable internet. I have the latest version of BTT and the GoldenChaos preset 2.639-3 - is this issue fixed in a recent update? Does the same thing happen to you when you disable internet, or is this just me?

@MaximilianP it's defined in the "Other" tab with the various named Setting triggers :slight_smile: specifically, find the named trigger called "Check Date/Time Settings". In general, variables are set inside named triggers that start with either "Check" or "Refresh".

@Andreas_Hegenberg it worked!!!! microphone mute bug here I come

@lingdoc I'm not seeing such an issue here, but let me spend more time testing it before I put out the next stable version.

Hi, wanted to say thank you for the amazing work.

For Better Touch Tool

And for Golden-Chaos

Do you think you may be able to create a countdown timer widget ? I am a pomodoro user (25min countdown)

Thank you !

2 Likes

Hello, first of all, thank you for this absolutely amazing update.

Secondly, is there a way to create a preset file from the current settings?

2 Likes

Thank you @GoldenChaos for your useful reply explaining some of the options!

Also thank you @Andreas_Hegenberg for explaining how to enable app specific Touch Bar override.

Yes! I will put instructions in the first post for this. For now:

  1. Navigate to the "Other" tab in BTT, you'll see the two included presets right at the top.
  2. You can copy them and make your own!
  3. To add your custom preset button to the GC-BTT settings menu:
    1. Navigate to the "Touch Bar" tab in BTT
    2. Open up the modal widget group "GC-BTT Settings"
    3. Find the Presets section by scrolling down a bit, then copy one of the buttons in there and edit to whatever you named your preset.
  4. Make sure to keep the "Check All Settings" trigger at the end of the preset so that GC-BTT safely refreshes its settings :slight_smile:

If you don't want your custom preset scripts to get deleted when you upgrade, make sure to copy them over into a BetterTouchTool preset separate from GC-BTT.

@Futil I didn't forget you!! I don't personally use pomodoro, are there any awesome pomodoro apps that it would be useful to integrate with? Or would a generic timer function be more useful?

Hi @GoldenChaos,

I may have done something wrong with the upgrade, but after reapplying the settings it doesn't appear to have reapplied them...

So, I was on 2.639-4 and had gone into GC-BTT Settings menu via ⌘⌥⇧P to try some custom settings. Two obvious ones were enabling the wifi button and removing the date so it just showed time.

To upgrade, I disabled the preset by unticking the Active box (maybe I should have deleted it?), clicked the 2.641 link and chose Direct Import to BTT. Upon restarting BTT, I went back into GC-BTT Settings menu and pressed Reapply Settings - it went through the progress bar and went back to the normal view. I now found the wifi button was no longer there and the full date is showing again.

Happy to report back on any tests you'd like me to do.

Listen to your instincts - you did have to fully delete it :wink:

1 Like

I can hear an echo somewhere saying rtfm... rtfm... rtfm... (I remembered reading it in the Upgrade notes, but forgot at the time - sorry about that) :wink:

1 Like

Am I doing something wrong with the thumbs up/down keys for Spotify? They don't seem to have an effect..

And I found the named Trigger: Check Date/Time Settings and changed the time format how I wanted.
But it seems that the time format comes from somewhere else, and I haven't figured out where.
At least is my setting not reflected.

	set dateFormat24Hour to ""
	try
		set dateFormat24Hour to get_string_variable "dateFormatLarge24Hour"
	end try
	if dateFormat24Hour is missing value or dateFormat24Hour is "E MMM d H.mm" then
		-- if one's not set, assume they're all unset.
		-- set default values for all three date formats: large, medium and small
		set_persistent_string_variable "dateFormatLarge24Hour" to "E d MMM H.mm"
		set_persistent_string_variable "dateFormatMedium24Hour" to "d MMM H.mm"
		set_persistent_string_variable "dateFormatSmall24Hour" to "H.mm"
	end if

I have a few buttons made but disabled by default because they aren’t functionally implemented yet. Those are two of them :stuck_out_tongue_closed_eyes: also sadly not sure if it will ever be possible since Spotify doesn’t expose those actions anywhere that I can see. Maybe I’ll remove these buttons then, but am I really ready to give up on dreams?

EDIT: Missed the date/time formatting bit. I’ll write up an explanation shortly.

Ok, I hope I'm not missing something obvious here... :slight_smile:

If I tick the visible check box next to "Now Playing Actions", it appears in the Touch Bar which I can press and it reveals a very useful set of buttons to use while listening to music in iTunes (it could do with volume buttons in there too if possible please). However if I quit iTunes, that button stays visible, and I have to go back to preferences to hide it again.

I see there is a "Now Playing Widget" within Home Strip which appears when playing music, but pressing that doesn't do anything. Is there a way to make it open the Now Playing Actions instead, or is there another way to show a button that I can press to show Now Playing Actions please?

Edit: Actually, it turns out the best way to use those useful actions is to make them visible and hide the text, so I can just click on them to view their actions. :slight_smile:

ah okay :smiley: no worries! then I hide those buttons again :slight_smile:
I would be neat to access those to actions directly there. Spotify has them implemented in their TouchBar - is there a way to just link them?

No hurry on the date/time formatting. It is really not a biggie.

You're supposed to leave those groups hidden - you access them by long-pressing their associated widget or menu bar icon like so:

  • Long Press Now Playing Widget -> Now Playing Actions
  • Long Press Calendar or Date/Time -> Calendar Actions
  • Long Press Reminders Widget -> Reminders Actions
  • Long Press Volume Up/Wi-Fi/Bluetooth/"Connect to X" -> Connectivity Actions
  • Long Press Weather Widget -> 7-Day Forecast

So there's some logic to it :slight_smile: try long pressing on lots of things!

@MaximilianP I'll look into it, but last I remember it's not possible since the actions need to be exposed to AppleScript. I'll check again, but I'm like 98% positive it's not accessible.

1 Like

Custom Date/Time with GC-BTT solution!

You can add this preset underneath the other two and run it whenever you want. Simply change the three date formats to your liking. :slight_smile:

(You could also run this from any script editor, too. Plus, the setting will persist between upgrades!)

-- Custom 24-Hour Date/Time Format
-- This is a PRESET script, called from group GC-BTT Settings

tell application "BetterTouchTool"
	-- Bend the date/time format to our will
	set_persistent_string_variable "dateFormatLarge24Hour" to "E d MMM H.mm"
	set_persistent_string_variable "dateFormatMedium24Hour" to "d MMM H.mm"
	set_persistent_string_variable "dateFormatSmall24Hour" to "H.mm"

	-- Use 24-Hour Time
	set_persistent_string_variable "timeFormat" to "24Hour"

	-- Refresh the Date/Time widget
	trigger_named "Refresh Date/Time Widget"
end tell
1 Like

@GoldenChaos You said that in the latest release, High Sierra Media Key Enabler is no longer needed. Could you tell me how I can uninstall it?