set activeKbdLayout to my getActiveKeyboardLayout()
on getActiveKeyboardLayout()
set plistPath to "~/Library/Preferences/com.apple.HIToolbox.plist"
try
do shell script "defaults read " & plistPath & " dummy"
end try
tell application "System Events"
repeat with pli in property list items of ¬
property list item "AppleSelectedInputSources" of ¬
property list file plistPath
try
return value of property list item "KeyboardLayout Name" of pli
end try
end repeat
end tell
end getActiveKeyboardLayout
if activeKbdLayout is "Hebrew" then
return ""
else if activeKbdLayout is "ABC" then
return ""
end if
-- set IconPath to ((path to desktop folder from user Sagi) & "KeyboardInputs:" & activeKbdLayout & ".png") as string
Wow, I find this really appealing and useful! I don't like so much of the contextually dynamic set ups and thing you really got something here. Do you mind sharing the preset as a .btt?
I liked your preset. Touch Bar is a thin strip and there are not much things one can do with it.Contextually dynamic set ups is one of the best ways to use it.
Your preset resembles my preset Ingo2 that I posted here. Feel free to take a look and grab any part.