🆕 [v3.6.9] AquaTouch – The Powerful Touch Bar Redesign.

@platterfoot

Open "Script Editor" on your mac, and make a new document.

Put this script in and run, tell me what number shows up

if application "Spotify" is running then
	tell application "Spotify"
		try
			if player state is playing then
				set sName to (get name of current track)
				set sArtist to (get artist of current track)
				
				if (length of sName) > 25 then
					set sName to text 1 thru 22 of sName & "..."
				else
					set sName to (get name of current track)
				end if
				if (length of sArtist) > 25 then
					set sArtist to text 1 thru 22 of sArtist & "..."
				else
					set sArtist to (get artist of current track)
				end if
				if sArtist is not "" then
					set nowPlaying to sName & "  —  " & sArtist
				else
					set nowPlaying to sName
				end if
				
				--fix JSON-Breaking Double Quotes
				set aString to nowPlaying
				set astid to AppleScript's text item delimiters
				set AppleScript's text item delimiters to quote
				set aString to text items of aString
				set AppleScript's text item delimiters to "\\" & quote
				set aString to aString as text
				set AppleScript's text item delimiters to astid
				-- Quotes have been vanquished
				set nowPlaying to aString
				
				set artworkURL to artwork url of current track
				
				set fileName to ((((path to application support folder from user domain) as text) & "BetterTouchTool:" as text) & "spotify_cover.png")
				
				set sNamePlist to ""
				set sArtistPlist to ""
				set plistfile_path to ((((path to application support folder from user domain) as text) & "BetterTouchTool:" as text) & "spotify_playing.plist")
				
				set returnText to "{\"text\":\"" & nowPlaying & "\",\"font_color\": \"255,255,255,255\", \"icon_path\":\"" & (POSIX path of fileName as text) & "\" }"
				
				-- read the plist file
				tell application "System Events"
					try
						if file plistfile_path exists then
							tell property list file plistfile_path
								tell contents
									set sNamePlist to value of property list item "sName"
									set sArtistPlist to value of property list item "sArtist"
								end tell
							end tell
						end if
						if (sName is sNamePlist) and (sArtist is sArtistPlist) then
							--return "Found it!"
							tell application "BetterTouchTool" to set_string_variable "ShowNotPlayingMsg1" to "false"
							--return returnText
							return "1"
							
						end if
					on error
						tell application "BetterTouchTool" to set_string_variable "ShowNotPlayingMsg1" to "true"
						--return "{\"text\":\" Spotify \",\"font_color\": \"255,255,255,255\"}"
						return "2"
					end try
				end tell
				
				if (sName is not sNamePlist) or (sArtist is not sArtistPlist) then
					
					tell application "System Events"
						try
							-- create an empty property list dictionary item
							set the parent_dictionary to make new property list item with properties {kind:record}
							
							-- create new property list file using the empty dictionary list item as contents
							set this_plistfile to ¬
								make new property list file with properties {contents:parent_dictionary, name:plistfile_path}
							make new property list item at end of property list items of contents of this_plistfile ¬
								with properties {kind:string, name:"sName", value:sName}
							make new property list item at end of property list items of contents of this_plistfile ¬
								with properties {kind:string, name:"sArtist", value:sArtist}
						on error
							tell application "BetterTouchTool" to set_string_variable "ShowNotPlayingMsg1" to "true"
							--return "{\"text\":\" Spotify \",\"font_color\": \"255,255,255,255\"}"
							return "3"
						end try
					end tell
					
					do shell script "curl " & artworkURL & " -o ~/Library/Application\\ Support/BetterTouchTool/spotify_cover.png"
					
					tell application "BetterTouchTool" to set_string_variable "ShowNotPlayingMsg1" to "false"
					--return returnText
					return "4"
					
				end if
			else
				tell application "BetterTouchTool" to set_string_variable "ShowNotPlayingMsg1" to "false"
				--return "{\"text\":\" Spotify \",\"font_color\": \"255,255,255,255\"}"
				return "5"
			end if
		on error
			tell application "BetterTouchTool" to set_string_variable "ShowNotPlayingMsg1" to "false"
			--return "{\"text\":\" Spotify \",\"font_color\": \"255,255,255,255\"}"
			return "6"
		end try
	end tell
else
	tell application "BetterTouchTool" to set_string_variable "ShowNotPlayingMsg1" to "true"
	return "7"
end if

@yuuiko

After installing the latest BTT update I ran into the same issue as @platterfoot. I tried the script you posted and it returned "1". Also, now the "current song" is gone entirely on the Spotify app set.

1 Like

song playing it returned 1, song paused it returned 5

1 Like

Hi, im new here, im having trouble when enter to YouTube the stock Touch Bar appears and can't use de YouTube widget that you made, unless go yo the AquaTouch button then YouTube, but every time I change tabs, when go I back to the YouTube tab again the stock Touch Bar appears

to create a toggle button for sidecar , this script work perfectly on and off. no need to go to setting anymore :):

tell application "System Preferences"

activate

set the current pane to pane id "com.apple.preference.sidecar"

get the name of every anchor of pane id "com.apple.preference.sidecar"

delay 1

tell application "System Events"

set target_button to a reference to (first button whose name is "Disconnect") of (window "Sidecar" of application process "System Preferences")

if target_button exists then

click target_button

else

click menu button "Select Device" of window "Sidecar" of application process "System Preferences"

count menu items of menu of menu button "Select Device" of window "Sidecar" of application process "System Preferences"

select item 1 of menu button "Select Device" of window "Sidecar" of application process "System Preferences"

key code 125

key code 76

end if

end tell

quit

end tell

1 Like

@Pepe_Grillo

Try this:

See more at:

@DecafMountain0 @platterfoot

I can't tell exactly whats wrong with the spotify widget but I can definitely tell that something is wrong.

Results helped, I'll probably rewrite the script as it looks a mess. will @mention again once I do but for now I'm quite busy with assessments

1 Like

ok thank you for the reply and look forward to seeing more of your work :slight_smile:

1 Like

We can get support for Microsoft Edge?

2 Likes

I'm having an issue going right a tab on chrome. Going left a tab is fine. Safari works fine with both. I'm on the newest version 3.5.8a on Mac 10.15.4 and Chrome Version 81.0.4044.138 (Official Build) (64-bit) with a MacBook Pro 16.

1 Like

@ivanzud @hiimburger

Received! will look into it though I'm quite busy right now.

So sorry for the late reply too!

Really loving this. One thing GoldenChaos has that I love is the 1Password button for fast access to 1password. I wonder if there's a way to add it to AquaTouch somehow/somewhere. Or is there a way I could add it myself manually so it's there sitting next to the TouchID button ready and waiting?

Also, and forgive me if this is already an option and I'm just missing it; is there a way to set the default behaviour when in an app that isn't supported to not show the gesture bar and just show the stock Touch Bar options? I'd rather not have to tap that little area before I see the stock options, especially since most of the apps I currently use don't have AT presets, but do have their own Touch Bar buttons.

Thanks!

Again, really impressed with this thing!!

I'm using AQT for a while now and I've made some modifications to meet my needs.

Theses modifications includes new apps support and in order to make it work I added the names of the apps in the Unsupported Apps group conditions and I was wondering if anyone know if these conditions are in the AQT preset or in the preset the where made. (so when updating AQT I would still keep the new conditions)

Thanks!

@adamschoales

1password button added to my list! You can probably copy-paste GoldenChaos's one into the QuickApps or Quick Strip itself if you wish.

Locations are
"QuickStrip" for adding it to the QuickStrip,
"QuickStrip Widgets" for adding it into the QuickStrip Menus.

Strange as AQT should auto-close on that setting... Check:


@dfrigon
Wow! Very curious for what you have added. If you're comfortable could I have a copy of what you've added? Maybe if the additions are good for all people i can add it in to AQT itself with credit!

As for the apps list i think the one on the top of this post is fairly accurate.

One thing you might consider is to put your modifications in your own seperate preset and set both AQT and this custom preset as active. Read more about this in the AQT help (open BTT and tap it in the touchbar)

@yuuiko

Are there any plans to support other Microsoft apps such as Word, Excel, Powerpoint, etc.?

Also, I'm playing around with the Music and Spotify scripts (the one where if clicked, will show the song bar and allows you to scroll). However, when I paste it into a separate preset (along with their respective folders), it keeps trying to open Music and Spotify apps. Any idea why, and can I fix this?

The modifications i've made are mostly for my own preferences and app usage and I don't think it would apply to everyone yet! I just wanted a better way to update AQT without having to change every settings I've adapted.

One thing I would suggest though is the finder button in the QuickApps group. When I used it it was always opening 2 windows at once and I found a much reliable way to do the same. I've changed the behavior to "Send shortcut to specific app" and then send cmd+n to Finder.app.

One other thing that is really helpful to me is the Clipboard Manager Widget. I've created a control modifier group with this widget in so when I hold control in any applications I have access to my clipboard history.

I don't know if I've messed up something but since i've updated to the latest release i'm not able to toggle between BTT touch bar and mac touchbar with the fn key. I see the touchbar changing but it return right back to BTT.

Well I tried copying 1Password (using the move in BTT), and somehow it did not work and now it's gone from GoldenChaos. WHOOPS! haha.

how can I disable AQT 3.5.8 update notifications? whenever I open my Mac I get the notification and I'm not ready to update yet

@Ryan_Mak

Currently the main focus is stability, and adding Catalina features.
Doesn't microsoft office already have decent touchbars? I personally use iWork instead of office so correct me if i'm wrong, but what do you think is missing in office's touchbars?


@dfrigon

If you're modifications are added, there's a way to keep them seperate from AQT and let BTT combine it, which means you can update with relative ease.

This doesn't work however if you modify AQT itself, such as editing/removing its widgets.

Have you seen the tip in the usage manual? The instructions there aren't that clear I know but its a start. If you need more help then just ask me

Strange your FN key is working like that.. Check the trigger in the [key sequences] input method, that's where the fn tap is.

Currently, this is the FN tap trigger, copy-paste it in

[
  {
    "BTTTriggerType" : 624,
    "BTTTriggerTypeDescription" : "Please Select a Trigger ",
    "BTTTriggerClass" : "BTTTriggerTypeKeySequence",
    "BTTPredefinedActionType" : 188,
    "BTTPredefinedActionName" : "Toggle BetterTouchTool Touch Bar",
    "BTTEnabled2" : 1,
    "BTTAlternateModifierKeys" : 0,
    "BTTRepeatDelay" : 0,
    "BTTUUID" : "40DD1D9E-7416-49D8-BCBB-6C847BE9E13C",
    "BTTNotesInsteadOfDescription" : 0,
    "BTTEnabled" : 1,
    "BTTModifierMode" : 0,
    "BTTOrder" : 0,
    "BTTDisplayOrder" : 0,
    "BTTKeySequence" : {
      "BTTPauseBetween" : 0.17821691176470592,
      "BTTKeyCount" : 2,
      "BTTKeySequenceDownKeys" : [
        {
          "BTTKEYCharacter" : "fn ",
          "BTTKEYCode" : 63,
          "BTTKEYDown" : 1,
          "BTTKEYOrderRelevant" : 1,
          "BTTKEYRequired" : 1
        }
      ],
      "BTTKeySequenceMixedKeys" : [
        {
          "BTTKEYCharacter" : "fn ",
          "BTTKEYCode" : 63,
          "BTTKEYDown" : 1,
          "BTTKEYOrderRelevant" : 1,
          "BTTKEYRequired" : 1
        },
        {
          "BTTKEYCharacter" : "fn ",
          "BTTKEYCode" : 63,
          "BTTKEYRequired" : 1
        }
      ],
      "BTTKeySequenceUpKeys" : [
        {
          "BTTKEYCharacter" : "fn ",
          "BTTKEYCode" : 63,
          "BTTKEYRequired" : 1
        }
      ]
    }
  }
]

@adamschoales

oops! ahah, I'll check it out and see what I can do then. It might be a little wait. If I can pull it off i might be able to hand you a widget that you can paste in.


@Duval_Barrett

Should be in AQT settings, you can get to it by opening BTT configuration, then swiping the touchbar.