Blue Eye Logo

Blue Eye Macro

Automation is freedom
It is currently Thu Nov 21, 2024 7:41 pm

All times are UTC




Post a reply
Username:
Subject:
Message body:
Enter your message here, it may contain no more than 60000 characters. 

Smilies
:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :arrow: :| :mrgreen: :geek: :ugeek:
Font size:
Font colour
Options:
BBCode is ON
[img] is OFF
[flash] is OFF
[url] is ON
Smilies are ON
Disable BBCode
Disable smilies
Do not automatically parse URLs
Please click and drag the 2 correct statements to the right hand side.
Please click and drag the 2 correct statements to the right hand side.
Please select the options below to the correct list to avoid automated registrations.
Statements
2 correct statements
Dogs have 4 legs
Chickens can talk
Fish can swim
Elephants can fly
   

Topic review - iTunes remote
Author Message
  Post subject:  Re: iTunes remote  Reply with quote
if this work it will be nice..
wanna try it right now :D :D :D
thx anyway :D :D :D
Post Posted: Tue Jan 22, 2013 12:30 pm
  Post subject:  Re: iTunes remote  Reply with quote
omg never thought that BE-M would work with iTunes

This is so good

Thank you very much for sharing this
Post Posted: Tue Jan 22, 2013 12:27 pm
  Post subject:  iTunes remote  Reply with quote
in case your keyboard does not have media control keys, this will send commands to iTunes.

left control + right = next song
left control + left = previous song
left control + up = volume up
left control + down = volume down
left control + space = pause/play or start iTunes... it does not start playing automatically yet i may try again later
hold control after a direction = repeat

i may try to get it working better or clean up the code, anyway it covers the basics for now. set start trigger to {<lcontrolkey>}
Code:
 begin
     Keyboard.Suppress keys("{<left>}{<right>}{<up>}{<down>}{<space>}")
     // keep this lower than repeat_search_pause
     Variable.Set("milliseconds_to_wait", "10")
     // ms to hold the key
     Variable.Set("hold_pause", "1")
     // detection interval
     Variable.Set("repeat_search_pause", "50")
     // how long until it repeats command if control held
     Variable.Set("repeat_key_pause", "1500")
     // time to wait after starting iTunes and playing first song
     Variable.Set("start_wait", "2000")
     if  Variable.Does not exist("time")
          begin
               Macro.Start stopwatch("last_pressed")
          end
     if  Window.Is running("iTunes", "yes")
          begin
               Variable.Set("running", "yes")
          end
     Keyboard.Get last key press("key")
     if  Variable.Is equal to("key", "left")
          and
          Variable.Exists("running")
          begin
               Window.Send hold keys("iTunes", "yes", "0", "{<rcontrolkey>}")
               Window.Send hold keys("iTunes", "yes", "0", "{<left>}")
               Macro.Pause("{hold_pause}")
               Window.Send release keys("iTunes", "yes", "0", "{<left>}")
               Window.Send release keys("iTunes", "yes", "0", "{<rcontrolkey>}")
               Keyboard.Unsuppress keys("{<left>}{<right>}{<up>}{<down>}{<space>}")
               Macro.Pause("{repeat_key_pause}")
          end
     if  Variable.Is equal to("key", "right")
          and
          Variable.Exists("running")
          begin
               Window.Send hold keys("iTunes", "yes", "0", "{<rcontrolkey>}")
               Window.Send hold keys("iTunes", "yes", "0", "{<right>}")
               Macro.Pause("{hold_pause}")
               Window.Send release keys("iTunes", "yes", "0", "{<right>}")
               Window.Send release keys("iTunes", "yes", "0", "{<rcontrolkey>}")
               Keyboard.Unsuppress keys("{<left>}{<right>}{<up>}{<down>}{<space>}")
               Macro.Pause("{repeat_key_pause}")
          end
     if  Variable.Is equal to("key", "up")
          and
          Variable.Exists("running")
          begin
               Window.Send hold keys("iTunes", "yes", "0", "{<rcontrolkey>}")
               Window.Send hold keys("iTunes", "yes", "0", "{<up>}")
               Macro.Pause("{hold_pause}")
               Window.Send release keys("iTunes", "yes", "0", "{<up>}")
               Window.Send release keys("iTunes", "yes", "0", "{<rcontrolkey>}")
               Keyboard.Unsuppress keys("{<left>}{<right>}{<up>}{<down>}{<space>}")
               Macro.Pause("{repeat_key_pause}")
          end
     if  Variable.Is equal to("key", "down")
          and
          Variable.Exists("running")
          begin
               Window.Send hold keys("iTunes", "yes", "0", "{<rcontrolkey>}")
               Window.Send hold keys("iTunes", "yes", "0", "{<down>}")
               Macro.Pause("{hold_pause}")
               Window.Send release keys("iTunes", "yes", "0", "{<down>}")
               Window.Send release keys("iTunes", "yes", "0", "{<rcontrolkey>}")
               Keyboard.Unsuppress keys("{<left>}{<right>}{<up>}{<down>}{<space>}")
               Macro.Pause("{repeat_key_pause}")
          end
     if  Variable.Is equal to("key", "space")
          begin
               Keyboard.Suppress keys("{<lcontrolkey>}")
               if  Variable.Does not exist("running")
                    begin
                         System.Launch application ("iTunes", "no")
                         Keyboard.Unsuppress keys("{<left>}{<right>}{<up>}{<down>}{<space>}")
                         Macro.Pause("{start_wait}")
                         Window.Minimize("iTunes", "yes")
                         Macro.Pause("400")
                         Window.Send hold keys("iTunes", "yes", "0", "{<rcontrolkey>}")
                         Window.Send hold keys("iTunes", "yes", "0", "{<right>}")
                         Macro.Pause("{hold_pause}")
                         Window.Send release keys("iTunes", "yes", "0", "{<right>}")
                         Window.Send release keys("iTunes", "yes", "0", "{<rcontrolkey>}")
                         Macro.Pause("30")
                         Window.Send hold keys("iTunes", "yes", "0", "{<space>}")
                         Macro.Pause("{hold_pause}")
                         Window.Send release keys("iTunes", "yes", "0", "{<space>}")
                         Macro.Pause("{hold_pause}")
                         Window.Send hold keys("iTunes", "yes", "0", "{<space>}")
                         Macro.Pause("{hold_pause}")
                         Window.Send release keys("iTunes", "yes", "0", "{<space>}")
                         Macro.Pause("{hold_pause}")
                    end
               Window.Send hold keys("iTunes", "yes", "0", "{<space>}")
               Macro.Pause("{hold_pause}")
               Window.Send release keys("iTunes", "yes", "0", "{<space>}")
               Keyboard.Unsuppress keys("{<left>}{<right>}{<up>}{<down>}{<space>}")
               Macro.Pause("{repeat_key_pause}")
               Keyboard.Unsuppress keys("{<lcontrolkey>}")
          end
     if  Keyboard.Key is held down("{<lcontrolkey>}")
          begin
               Macro.Restart stopwatch("last_pressed")
          end
     Macro.Read stopwatch("last_pressed", "time")
     if  Variable.Is equal to("key", "{<lcontrolkey>}")
          or
          Variable.Is less than (Math)("time", "{milliseconds_to_wait}")
          begin
               Function.Execute("restart")
          end
     Function.Execute("stop")
 end

function("restart")
     begin
          Macro.Pause("{repeat_search_pause}")
          Macro.Restart("no")
     end
function

function("stop")
     begin
          Keyboard.Unsuppress keys("{<left>}{<right>}{<up>}{<down>}{<space>}")
          Macro.Abort()
     end
function
 
Post Posted: Fri Nov 23, 2012 9:36 am

All times are UTC


Jump to:  


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group