Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

To-do: Next song on Focus@will #1

Closed
yigitkonur opened this issue Apr 1, 2015 · 6 comments
Closed

To-do: Next song on Focus@will #1

yigitkonur opened this issue Apr 1, 2015 · 6 comments

Comments

@yigitkonur
Copy link

Thank you tangledhelix, it works great on Chrome. Is that possible to skip on next song, just writing something like -focus next-.

Thanks!

@tangledhelix
Copy link
Owner

Good idea, I've added that support for the keyword and hotkey. See the readme for info.

@yigitkonur
Copy link
Author

Thank you so much, what an instant developement :)

@yigitkonur
Copy link
Author

Also, is that possible to change concept like ambient to cinematic with a comment?

@tangledhelix
Copy link
Owner

I haven't worked this out yet (partly because I uninstalled Chrome due to its terrible battery impact), but note to self on general Javascript to get the info and do click... haven't figured out how to get this back to Applescript/Alfred though. This Javascript works in the Safari console (and will probably work in the Chrome console), but Applescript doesn't get the console output back. I might try to do this in Javascript in Script Editor, but if I remember right, Javascript is only supported as an automation language in Yosemite and maybe Mavericks, so that would exclude users of older OS's. And it also may not work anyway.

// Get a list of genres and the associated list index
$('li.genre a').each(function(i,a){console.log(i, a.innerHTML);});

// Click a given genre button, given its list index
$('li.genre a')[10].click();

@tangledhelix tangledhelix reopened this Apr 17, 2015
@tangledhelix
Copy link
Owner

So far as I can tell there is no way to get data about the page contents out of Chrome and into Applescript (or Automation Javascript). So there is no elegant way to do this that I can see. I can add a static map, but every time focusatwill changes the pulldown, there is the potential that the mapping would become inaccurate. I think they usually add to the end of the list, so that may be okay.

@tangledhelix
Copy link
Owner

I can't get a genre list live from the browser. I have made a static list and added support with the new keyword "focg" (focus genre) that uses a script filter to choose a genre from a list using a substring (e.g. "focg alph" would give you Alpha Chill. See the readme, and the new workflow file is in the most recent commit in this repo.

Enjoy... thanks for the suggestion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants