Jump to content

big itunes help help


Recommended Posts

I've just downloaded Autoit. I know nothing of scripts or scripting, but I would really, really love those who could offer me advice for how to make this sort of script for itunes.

All I want itunes to do is play the sample music in the music store CONTINOUSLY. Meaninging once it's played the first 30 seconds of the preview, it jumps down to the following track and continous to play the following 30 seconds, like a playlist.

Is there a code to make this happen? I have a windows vista and use itunes 6, but I'll be happy to downgrade or upgrade if it's easier to form a script for a different version.

I know this may be a very easy question, but I've been searching all over the internet for days to make Itunes do this and have come down to my last hope...I really appreciate your input ^^

Link to comment
Share on other sites

Hey totallylost, welcome to the forums.

If you search you can find the iTunes UDF- if you have a bit of a play you should be able to work something out. If not, post your attempts. Who knows, you might have made the smallest mistake.

Alternatively you could build your own media player using BassLib (see my sig) or a similar set of functions (such as SoundPlay()).

I prefer BassLib due to the ability to apply effects and the like.

Cheers,

Brett

Link to comment
Share on other sites

Link to comment
Share on other sites

As far as I know I don't think you can automate the controls in the iTunes store. I wouldn't be surprised if its blocked, but I know that play/pause and next track don't work when you have the store open but it will work with any playlist. I currently don't have iTunes at work or I would try some more, but its doubtful.

Link to comment
Share on other sites

I hate to see you go away empty handed...

this is very primitive but it works on my PC:

WinActivate("[CLASS:iTunes]", "")
Sleep(200)
MouseClick("left", 261, 286,1) ; click on the play button

Sleep(31000) ;wait for the song to finish

MouseClick("left", 261, 312,1) ;vertical mouse coord +26

Sleep(31000) ;wait for the song to finish

MouseClick("left", 261, 338,1) ; vertical mouse coord +26

; and so on with the next coords

This may not work "as is" on your PC but at least you see what needs to be done.

Good Luck !

Bill

Link to comment
Share on other sites

You can find the UDF here.

This should work. Untested.

#include <iTunes.au3>
#Include <Date.au3>

$PlayList_Name = "Hip-Hop"
$nTimeout = 30*1000 ; 30 seconds
$nTimeout = 2*1000 ; 2 seconds
$sLoaded = ""

;Start the object
_iTunes_Start()

;Play the first song in the playlist
_iTunes_Playlist_PlayFirst($PlayList_Name)

$sLoaded = _GetSongNameID()
;Start the timer
$timer = TimerInit ()

OnAutoItExitRegister ("iTunesExit")

While 1
    ;Check to see if the loaded song is the same.  If Not Reset the timer.
    $sNow = _GetSongNameID ()
    If $sLoaded <> $sNow Then
        ;So we don't reset the timer again
        $sLoaded = $sNow
        ;Reset the timer
        $timer = TimerInit ()
    EndIf

    ;See if the elapsed is greater than the timeout
    If TimerDiff ($timer) >= $nTimeout Then
        ;Play the next song.
        _iTunes_Next()
    Else
        ;Conserve CPU
        Sleep(500)
    EndIf
WEnd

Func iTunesExit()
    _iTunes_Unload()
EndFunc

Func _GetSongNameID ()
    $aInfo = _iTunes_Current_GetInfo()
    Return $aInfo[2]
EndFunc
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...