Coder Social home page Coder Social logo

alfred-youtube-music-control's People

Contributors

carceneaux avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

alfred-youtube-music-control's Issues

execution error: Unknown type class (-2700)

As soon as I typed ym into Alfred I get the error below:

image

I have YouTube music as an open tab in Chrome and I already enabled Allow JavaScript from Apple Events

I'm currently on Chrome Version 92.0.4515.131 (Official Build) (arm64)

I'm on Alfred version 4.5.1 Build 1256

And this is my machine:
image

Control audio

how would i control the volume of the player?

testet something like this (but it's not working yet):

on alfred_script(q)
tell application "Google Chrome"
  set allWins to every window
  set allTabs to {}
    repeat with currWin in allWins
      set allTabs to allTabs & every tab of currWin
    end repeat
    repeat with currTab in allTabs
      try
        if (title of currTab) contains "Youtube Music" then set musicTab to currTab
      end try
    end repeat
  tell musicTab to execute javascript "(document.querySelector('[aria-label=\"Decrease volume\"]')).click();"
end tell
end alfred_script

[Solved] Fix to Previous & Next no long working

Recently the Previous & Next functions (shortkey and ym..next and ym..previous) no longer worked. As Google recently changed the aria-label for Previous and Next buttons on the web player.

Make script changes to Previous and Next:
2023-03-07 at 06 55 04

to:
2023-03-07 at 06 52 32

Thanks @carceneaux for creating this plugin. It's fantastic! ๐Ÿ˜ธ

search youtube improved

i also did some changes to "ym search" i wanted to share. like for other commands the script looks for an existing tab with music.youtube.com open, if it finds one the query is passed to that already open tab, if it does not it opens a new tab with the query.

on alfred_script(q)
	set query to q
	set musicTab to false
	tell application "Brave Browser"
		set allWins to every window
		set allTabs to {}
		repeat with currWin in allWins
			set allTabs to allTabs & every tab of currWin
		end repeat
		repeat with currTab in allTabs
			try
				if (title of currTab) contains "Youtube Music" then set musicTab to currTab
			end try
		end repeat
		if musicTab = false then
			tell application "Brave Browser" to open location "https://music.youtube.com/search?q=" & query
		else
		    set URL of musicTab to "https://music.youtube.com/search?q=" & query	
		end if
	end tell
end alfred_script

update to volume script

thanx for adding the volume-feature.
did some adjustments in order to control the volume with hotkeys to increase and decrease it by "20".
cheers
bendsch

on alfred_script(q)
	tell application "Brave Browser"
		set allWins to every window
		set allTabs to {}
		repeat with currWin in allWins
			set allTabs to allTabs & every tab of currWin
		end repeat
		repeat with currTab in allTabs
			try
				if (title of currTab) contains "Youtube Music" then set musicTab to currTab
			end try
		end repeat
		
		
		tell musicTab
			set vol to execute javascript "(document.querySelector('[aria-label=\"Volume\"]')).getAttribute('value');"
			set vol to vol + 20
			execute javascript "(document.querySelector('[aria-label=\"Volume\"]')).setAttribute('value', " & vol & ");"
		end tell
		
	end tell
end alfred_script

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.