AutoHotkey Community

It is currently May 27th, 2012, 7:57 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: December 5th, 2006, 12:27 pm 
Hey,
I'm an avid user of the music site http://www.pandora.com, and they have a flash player that is used to playback content. As I usually listen to this at work, and frequently need to pause when interrupted, I thought about having a hotkey to pause playing when the site is open. All I have to do is to send {Space} to the flash activeX object within the browser page, but so far I haven't really succeeded in doing that.

I've been going at it for a few hours, trying to figure out how to do this while using all sorts of different class handlers but none seems to work. Does anyone have an idea?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: December 5th, 2006, 1:17 pm 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
You will probably have to use javascript to achieve that.

You can also see if there is any interface to the mentioned player. Flesh allows to accept driving via java scripting witch is often used on web pages do redirect HTML input to Flash movie. If such mechanism is implementd, for instance via some form of play, pause etc.. commands using js functions, you can easily achieve that.


Some thought is floating in my head that you might be able to control flash from js even if flash was not designed for such thing.... you will have to examine javascript and Flash communication. Google a little.

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 5th, 2006, 3:29 pm 
It doesn't make any sense - after all, if the window is focused when the space space key is pressed in the browser, the flash componenet receives the action. So how hard can it be to send a key to the browser window?


Report this post
Top
  
Reply with quote  
PostPosted: December 5th, 2006, 7:19 pm 
Offline
User avatar

Joined: December 20th, 2004, 12:19 pm
Posts: 798
Location: LooseChange911.com Ask Questions, Demand Answers █ The WTC bldgs █ shouldn't have fallen █ that fast
To send any keys to flash...even for real...you need to click on the flash somewhere to focus it...which would mean your pause button would need to...switch to the browser window, click in a non-hyperlinked spot on the flash...then press space...if you can scroll the flash out of the viewable browser window...then that is another problem...the script would have a hard time clicking/finding it...so any solution wouldn't be perfect...but it should be doable...

_________________
AutoHotkey-Hotstring.ahk - Helping the world spell "AutoHotkey" correctly! (btw, it's a lowercase k!)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 6th, 2006, 8:12 am 
A solution I found was to active the right window and to use {click} at the right coordinates to catch the button. However I'd like to switch back to the window I was working on before firing the script, how do I go about doing that?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: December 6th, 2006, 8:30 am 
Alright, here is the functional working script for pandora use. Please note that the coordinates are set according to my system specs and with Firefox - you might need to change yours accordingly:


Code:
  IfWinExist, Pandora
    {
   WinGetActiveTitle, WorkingWin
   WinActivate 
   Send  {Click 500, 410} 
   SetKeyDelay, 100
   SendEvent {Space}
   WinActivate, %WorkingWin%

    }
 
 


Report this post
Top
  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: bobbysoon, just me, sjc1000 and 72 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group