diff --git a/Chime Channel Chooser 1.3.alfredworkflow b/Chime Channel Chooser 1.3.2.alfredworkflow similarity index 96% rename from Chime Channel Chooser 1.3.alfredworkflow rename to Chime Channel Chooser 1.3.2.alfredworkflow index bb91051..b4083b3 100644 Binary files a/Chime Channel Chooser 1.3.alfredworkflow and b/Chime Channel Chooser 1.3.2.alfredworkflow differ diff --git a/Chime Channel Chooser.scpt b/Chime Channel Chooser.scpt index 7699334..64bbcbb 100644 --- a/Chime Channel Chooser.scpt +++ b/Chime Channel Chooser.scpt @@ -1,31 +1,19 @@ -global fzfMatch - -on convertListToString(theList, theDelimiter) - set AppleScript's text item delimiters to theDelimiter - set theString to theList as string - set AppleScript's text item delimiters to "" - return theString -end convertListToString - on alfred_script(q) -clickChannel(q) + clickChannel(q) end alfred_script on clickChannel(q) ---CONFIG:Set path for dependancy cliclick (https://www.bluem.net/en/mac/cliclick/) -set cliclickpath to "/usr/local/bin/cliclick" --<--replace null with path of cliclick i.e. "/usr/local/bin/cliclick" + --CONFIG:Set path for dependancy cliclick (https://www.bluem.net/en/mac/cliclick/) + set cliclickpath to "/usr/local/bin/cliclick" -if cliclickpath is null then - return "ERROR: cliclickpath varriable is not set" -end if -set channelLocation to getChannel(q) + set channelLocation to getChannel(q) tell application "System Events" tell application "Amazon Chime" to activate tell application process "Amazon Chime" -- From http://macscripter.net/viewtopic.php?pid=170532#p170532 - perform action "AXRaise" of (first window whose name contains "Amazon Chime") + perform action "AXRaise" of (first window whose name contains "Amazon Chime") try @@ -50,14 +38,10 @@ on getChannel(q) tell application process "Amazon Chime" set allRowNames to get name of first UI element of every row of table 1 of scroll area 1 of splitter group 1 of window "Amazon Chime" - set channels to my convertListToString(allRowNames, " -") - set fzfMatch to do shell script "echo " & quoted form of channels & "| /usr/local/bin/fzf -f " & quoted form of q & "|head -1" - set iterate to 1 repeat with eachRowName in allRowNames log iterate & eachRowName - if text of eachRowName is fzfMatch then + if text of eachRowName is q then return iterate end if set iterate to iterate + 1 @@ -65,4 +49,4 @@ on getChannel(q) end tell end tell -end getChannel +end getChannel \ No newline at end of file diff --git a/ccc_filter.scpt b/ccc_filter.scpt index 218f64e..a0dc903 100644 --- a/ccc_filter.scpt +++ b/ccc_filter.scpt @@ -15,7 +15,7 @@ end tell set channels to my convertListToString(allRowNames, " ") -set fzfMatch to do shell script "echo " & quoted form of channels & "| /usr/local/bin/fzf -f " & quoted form of q +set fzfMatch to do shell script "echo " & quoted form of channels & "| /usr/local/bin/fzf -f " & quoted form of q & "| grep -v 'Chat Rooms\\|Recent Messages\\|Favorites'" set allMatches to paragraphs of fzfMatch