Search the Community
Showing results for tags 'speaker'.
Found 2 results
earthpyy posted a topic in Share your WorkflowsBluetooth Connect Connect/Disconnect paired bluetooth device THIS IS WHAT AIRPODS OWNERS ARE WAITING FOR! LOL Usage bt : Connect/Disconnect to favorite device bt <device name or alias> : Connect/Disconnect to any paired device Command + Enter / Command + Click to mark/unmark as favorite device btset <alias> > <device name> : Set an alias for a bluetooth device btset <alias> <device name> : Set an alias for a bluetooth device (short syntax, alias must not included space) btunset <alias>: Unset an alias Features Connect/Disconnect paired bluetooth device using macOS UI (AppleScript) Set an alias for a bluetooth device Mark a bluetooth device as your favorite device for easily access Todo Load device list from system profiler Detect which one should connect or disconnect to use as text in items Turn on automatic toggle when mark as favorite and only connect to device Connect bluetooth device without using UI GitHub earthpyy/alfred-bluetooth-connect Notes For latest feature and other information please visit GitHub Repository
shmulvad posted a topic in Workflow Help & QuestionsHey I'm trying to make an AppleScript to be run from Alfred, that should quickly set a specified speaker as audio output device if it is currently connected (in example below "My Awesome Speaker"), and otherwise don't do anything. I have gotten most of the functionality down (toggling between speaker/internal speaker), but I'm having a problem in the instance that the speaker isn't connected. When this is the case, the script has already clicked on the audioMenu, making the dropdown be there until a mouse click. I thought I could make it go away by branching with an "if else" and then if the speaker isn't connected, then just clicking the audioMenu again (because I've seen similar behaviour (with succes) for other menu bar scripts). But if I instead do this, the audio dropdown will still be staying until a click has been made, and then the script clicks the audio icon again making it doubly annoying. on alfred_script(q) set speakerName to "My Awesome Speaker" set internalSpeakers to "Internal Speakers" activate application "SystemUIServer" tell application "System Events" tell process "SystemUIServer" -- Working CONNECT Script. Goes through the following: -- Clicks on Audio Menu (OSX Top Menu Bar) -- Clicks your speaker if not connected -- Else if connected, then disconnects by clicking Internal Speakers set audioMenu to menu bar item 4 of menu bar 1 tell audioMenu click if exists menu item speakerName of menu 1 then set speakerMenuItem to menu item speakerName of menu 1 if value of attribute "AXMenuItemMarkChar" of speakerMenuItem is "✓" then click menu item internalSpeakers of menu 1 return "Disconnecting from " & speakerName & "..." else click speakerMenuItem return "Connecting to " & speakerName & "..." end if else -- Doesn't work for now. Just clicks it again after you deselect menu, making it double annoying --click audioMenu return "Doesn't look like you're connected to " & speakerName & "..." end if end tell end tell end tell end alfred_script How can I fix this, so the dropdown actually goes away if speaker is not connected?