Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details

If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.

Scripting the website commangs

If you have a question or need help, this is the place to be.
Post Reply
threedmind
Posts: 3
Joined: Fri Aug 19, 2011 12:36 pm

Scripting the website commangs

Post by threedmind »

Intro: so there is a website which streams music on-line and there are player buttons which were made in javascript (play, pause, previous song, next song)

Question: I'm looking for a way to bind these buttons to my keyboard keys so that I would be able to control this player in a easier way!

Up to this moment I did following:
1). Made an application out of this website (using the Chrome function), so now it's just a separate window and not a tab!!
2). Installed EventGhost and created FindWindow Macro which detects the window mentioned in p. 1.!

What's left? I need to find a way to click on javascript buttons!! (I don't want to use mouse_left_Button_click_on_a_a_certain_position because it'll interfere with my work on PC.. - I want to to be able launch this script in the background!)

3). I reviewed the page source of this website and playlist controls looks like this:

Code: Select all

<div class="prev" onmouseover="audioPlayer.highLight(this, 'prev', 1)" onmouseout="audioPlayer.highLight(this, 'prev', 0)" onmousedown="cancelEvent(event)" onclick="audioPlayer.prevTrack();" style="opacity: 0.6; "></div>
<div class="next" onmouseover="audioPlayer.highLight(this, 'next', 1)" onmouseout="audioPlayer.highLight(this, 'next', 0)" onmousedown="cancelEvent(event)" onclick="audioPlayer.nextTrack();" style="opacity: 0.6; "></div>
so how can I click on these buttons? I know their Classes, and onclick actions - is it possible to use them in an EventGhost?

P.S. if asked I can post a link to the website but I'm not sure if site rules allow it ;)
threedmind
Posts: 3
Joined: Fri Aug 19, 2011 12:36 pm

Re: Scripting the website commangs

Post by threedmind »

ok guys! I think I found something interesting:

if you put javascript: audioPlayer.nextTrack(); in address bar, then the site's system switches to the next song! (although Chrome doesn't support this feature in the latest version(firefox does))
is there any way to execute this action in chrome? I'm digging this problem right now..
threedmind
Posts: 3
Joined: Fri Aug 19, 2011 12:36 pm

Re: Scripting the website commangs

Post by threedmind »

remove my thread.. this task could be easily done with autohotkeys
Post Reply