Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 4c59017

Browse filesBrowse files
committed
Tweaking Sonos Applescripts
1 parent f20d3a7 commit 4c59017
Copy full SHA for 4c59017

2 files changed

+38-20Lines changed: 38 additions & 20 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file
86 Bytes
Binary file not shown.
Collapse file

‎workflows/sonos-toolkit/src/info.plist‎

Copy file name to clipboardExpand all lines: workflows/sonos-toolkit/src/info.plist
+38-20Lines changed: 38 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,9 @@
244244
<key>config</key>
245245
<dict>
246246
<key>applescript</key>
247-
<string>on alfred_script(q)
247+
<string>---- Raise Volume--
248+
249+
on alfred_script(q)
248250
tell application "System Events" to tell process "Sonos" set value of slider 1 of window 1 to get (value of slider 1 of window 1) + 5
249251
end tell
250252
end alfred_script</string>
@@ -314,7 +316,9 @@ end alfred_script</string>
314316
<key>config</key>
315317
<dict>
316318
<key>applescript</key>
317-
<string>on alfred_script(q)
319+
<string>---- Search--
320+
321+
on alfred_script(q)
318322
activate application "Sonos"
319323
tell application "System Events" to tell process "Sonos"
320324
set frontmost to true delay 1 set the value of text field 1 of window 1 to q
@@ -385,7 +389,9 @@ end alfred_script</string>
385389
<key>config</key>
386390
<dict>
387391
<key>applescript</key>
388-
<string>on alfred_script(q) tell application "System Events" to tell process "Sonos" set value of slider 1 of window 1 to get (value of slider 1 of window 1) - 5 end tellend alfred_script</string>
392+
<string>---- Lower Volume--
393+
394+
on alfred_script(q) tell application "System Events" to tell process "Sonos" set value of slider 1 of window 1 to get (value of slider 1 of window 1) - 5 end tellend alfred_script</string>
389395
<key>cachescript</key>
390396
<false/>
391397
</dict>
@@ -442,7 +448,9 @@ end alfred_script</string>
442448
<key>config</key>
443449
<dict>
444450
<key>applescript</key>
445-
<string>on alfred_script(q)try tell application "System Events" tell process "Sonos" set frontmost to true click menu item "Mini Controller" of menu 1 of menu bar item "Window" of menu bar 1 (* if exists (window 2 of process "Sonos") then*) click button 10 of window 2 (* Close Main Window *) end tell (* end if*) end tell return trueon error return falseend tryend alfred_script</string>
451+
<string>---- Switch to Mini Player--
452+
453+
on alfred_script(q)try tell application "System Events" tell process "Sonos" set frontmost to true click menu item "Mini Controller" of menu 1 of menu bar item "Window" of menu bar 1 (* if exists (window 2 of process "Sonos") then*) click button 10 of window 2 (* Close Main Window *) end tell (* end if*) end tell return trueon error return falseend tryend alfred_script</string>
446454
<key>cachescript</key>
447455
<false/>
448456
</dict>
@@ -488,7 +496,9 @@ end alfred_script</string>
488496
<key>config</key>
489497
<dict>
490498
<key>applescript</key>
491-
<string>on alfred_script(q)
499+
<string>---- Toggle Mute--
500+
501+
on alfred_script(q)
492502
tell application "System Events" tell process "Sonos" click button 1 of window 1
493503
end tell end tell
494504
end alfred_script</string>
@@ -508,18 +518,18 @@ end alfred_script</string>
508518
<key>argumenttype</key>
509519
<integer>2</integer>
510520
<key>keyword</key>
511-
<string>mute</string>
521+
<string>sonos</string>
512522
<key>subtext</key>
513-
<string>Mute Sonos playback</string>
523+
<string></string>
514524
<key>text</key>
515-
<string>Mute Volume</string>
525+
<string>Switch to Main Window</string>
516526
<key>withspace</key>
517527
<false/>
518528
</dict>
519529
<key>type</key>
520530
<string>alfred.workflow.input.keyword</string>
521531
<key>uid</key>
522-
<string>5B01F796-DF7B-45DC-941C-7BDFDDE6A2CD</string>
532+
<string>88E93D8B-D7A8-4D62-AFA7-4EE31077D2CA</string>
523533
<key>version</key>
524534
<integer>1</integer>
525535
</dict>
@@ -529,26 +539,28 @@ end alfred_script</string>
529539
<key>argumenttype</key>
530540
<integer>2</integer>
531541
<key>keyword</key>
532-
<string>sonos</string>
542+
<string>mute</string>
533543
<key>subtext</key>
534-
<string></string>
544+
<string>Mute Sonos playback</string>
535545
<key>text</key>
536-
<string>Switch to Main Window</string>
546+
<string>Mute Volume</string>
537547
<key>withspace</key>
538548
<false/>
539549
</dict>
540550
<key>type</key>
541551
<string>alfred.workflow.input.keyword</string>
542552
<key>uid</key>
543-
<string>88E93D8B-D7A8-4D62-AFA7-4EE31077D2CA</string>
553+
<string>5B01F796-DF7B-45DC-941C-7BDFDDE6A2CD</string>
544554
<key>version</key>
545555
<integer>1</integer>
546556
</dict>
547557
<dict>
548558
<key>config</key>
549559
<dict>
550560
<key>applescript</key>
551-
<string>on alfred_script(q)try tell application "System Events" tell process "Sonos" set frontmost to true click button "Button" of window 1 click menu item "Sonos Controller" of menu 1 of menu bar item "Window" of menu bar 1 end tell end tell return trueon error return falseend tryend alfred_script</string>
561+
<string>---- Switch to Main Window--
562+
563+
on alfred_script(q)try tell application "System Events" tell process "Sonos" set frontmost to true click button "Button" of window 1 click menu item "Sonos Controller" of menu 1 of menu bar item "Window" of menu bar 1 end tell end tell return trueon error return falseend tryend alfred_script</string>
552564
<key>cachescript</key>
553565
<false/>
554566
</dict>
@@ -706,7 +718,9 @@ fi</string>
706718
<key>config</key>
707719
<dict>
708720
<key>applescript</key>
709-
<string>on alfred_script(q) tell application "System Events" tell process "Sonos" click button 3 of window 1 end tell end tellend alfred_script</string>
721+
<string>---- Play/Pause--
722+
723+
on alfred_script(q) tell application "System Events" tell process "Sonos" click button 3 of window 1 end tell end tellend alfred_script</string>
710724
<key>cachescript</key>
711725
<false/>
712726
</dict>
@@ -742,7 +756,9 @@ fi</string>
742756
<key>config</key>
743757
<dict>
744758
<key>applescript</key>
745-
<string>on alfred_script(q) tell application "System Events" tell process "Sonos" click button 7 of window 1 end tell end tellend alfred_script</string>
759+
<string>---- Toggle Shuffle--
760+
761+
on alfred_script(q) tell application "System Events" tell process "Sonos" click button 7 of window 1 end tell end tellend alfred_script</string>
746762
<key>cachescript</key>
747763
<false/>
748764
</dict>
@@ -778,7 +794,9 @@ fi</string>
778794
<key>config</key>
779795
<dict>
780796
<key>applescript</key>
781-
<string>on alfred_script(q) tell application "Sonos" to activate tell application "System Events" to tell process "Sonos" set frontmost to true tell application "System Events" to tell process "Sonos" key code 123 using command down delay 0.2 key code 123 using command down end tell end tellend alfred_script</string>
797+
<string>---- Go to Previous Track--
798+
799+
on alfred_script(q) tell application "Sonos" to activate tell application "System Events" to tell process "Sonos" set frontmost to true tell application "System Events" to tell process "Sonos" key code 123 using command down delay 0.2 key code 123 using command down end tell end tellend alfred_script</string>
782800
<key>cachescript</key>
783801
<false/>
784802
</dict>
@@ -876,8 +894,8 @@ fi</string>
876894
<key>config</key>
877895
<dict>
878896
<key>applescript</key>
879-
<string>on alfred_script(q)
880-
tell application "Sonos" to activate tell application "System Events" key code 124 using {command down} end tell
897+
<string>---- Go to Next Track--on alfred_script(q)
898+
tell application "Sonos" to activate tell application "System Events" to tell process "Sonos" delay 1 try key code 124 using {command down} end try end tell
881899
end alfred_script</string>
882900
<key>cachescript</key>
883901
<false/>
@@ -1135,7 +1153,7 @@ Inspired by Jeff Johns’s [Sonos Sound Controls workflow](https://github.com/ph
11351153
<key>variablesdontexport</key>
11361154
<array/>
11371155
<key>version</key>
1138-
<string>0.1.1</string>
1156+
<string>0.1.2</string>
11391157
<key>webaddress</key>
11401158
<string>https://chrismessina.me</string>
11411159
</dict>

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.