totallylost Posted August 21, 2010 Share Posted August 21, 2010 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 More sharing options...
BrettF Posted August 21, 2010 Share Posted August 21, 2010 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 Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
totallylost Posted August 24, 2010 Author Share Posted August 24, 2010 Nah, this stuff really is all over my head. I really appreciate you directing me to the URL Brett but it's totally out of my league. I might mention something later if I find a downloadable file or some other method around this problem... Link to comment Share on other sites More sharing options...
BrettF Posted August 24, 2010 Share Posted August 24, 2010 Well you could create your playlist and make each of the songs only play for 30 seconds... RightClick -> Get Info on the particular song. Cheers, Brett Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
Baraoic Posted August 25, 2010 Share Posted August 25, 2010 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 More sharing options...
l3ill Posted August 25, 2010 Share Posted August 25, 2010 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 My Contributions... SnippetBrowser NewSciTE PathFinder Text File Manipulation FTP Connection Tester / INI File - Read, Write, Save & Load Example Link to comment Share on other sites More sharing options...
BrettF Posted August 26, 2010 Share Posted August 26, 2010 You can find the UDF here.This should work. Untested.expandcollapse popup#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 Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now