aboutsummaryrefslogtreecommitdiff
path: root/users/ryan/modules/simple-bar/simple-bar-source/lib/scripts/firefox-dev-audio.applescript
diff options
context:
space:
mode:
Diffstat (limited to 'users/ryan/modules/simple-bar/simple-bar-source/lib/scripts/firefox-dev-audio.applescript')
-rwxr-xr-xusers/ryan/modules/simple-bar/simple-bar-source/lib/scripts/firefox-dev-audio.applescript24
1 files changed, 24 insertions, 0 deletions
diff --git a/users/ryan/modules/simple-bar/simple-bar-source/lib/scripts/firefox-dev-audio.applescript b/users/ryan/modules/simple-bar/simple-bar-source/lib/scripts/firefox-dev-audio.applescript
new file mode 100755
index 0000000..6618fec
--- /dev/null
+++ b/users/ryan/modules/simple-bar/simple-bar-source/lib/scripts/firefox-dev-audio.applescript
@@ -0,0 +1,24 @@
1set browser to ""
2set title_string to ""
3set active_tab to 0
4
5to replace_chars(this_text, search_string, replacement_string)
6 set AppleScript's text item delimiters to the search_string
7 set the item_list to every text item of this_text
8 set AppleScript's text item delimiters to the replacement_string
9 set this_text to the item_list as string
10 set AppleScript's text item delimiters to ""
11 return this_text
12end replace_chars
13
14tell application "Firefox Developer Edition"
15 set the_title to (name of windows whose name contains "- YouTube") as text
16
17 if "- YouTube" is in the_title then
18 if active_tab is 0 then set title_string to " " & text 1 thru -11 of the_title
19 set browser to "firefox"
20 set active_tab to 1
21 end if
22end tell
23
24return "{ \"browser\": \"" & browser & "\", \"title\": \"" & replace_chars(title_string, "\"", "Ò") & "\" }"