Jump to content

How to auto sync Smartphone with iTunes


Recommended Posts

Guest wizgnome
Posted

I have my music library in iTunes on my PC and wanted to automatically copy playlists to my smartphone to listen to music, video and audio podcasts. Also i wanted to do this using freeware if possible.

Not being able to find any application off the shelf to do this I set about making it happen myself.

On the smartphone I have installed the TCPMP freeware media player - downloaded from http://picard.exceed.hu/tcpmp/test/

You should also download all the plugins from the same site and install on your smartphone.

For the apple AAC format I downloaded the aac codec from a previous version (apple asked the developer to remove it from the current release) - http://www.rarewares.org/files/aac/tcpmp_a...mobile.0.66.zip

In iTunes I have created some auto playlists "My Podcasts", "My Videos" "My Smartphone"

settings in general select by least recently played for the music, and play count less than 2 for the podcasts, with a limit on the max size - For the videos I limit the playing time.

To get the music out of iTunes I modified a script I found on http://www.teavuihuang.com/massstorsync/ - my version updates the play count and last played date so that the smart playlists work.

The batch file should be edited to reflect the names of the playlists to get from iTunes and the location of where you want the local sync directory to be and saved to a subdirectory on your PC along with the javascript file.

SYNC.BAT - cut, paste, edit and save!

@echo off

echo My Music

erase playlist.bat >nul 2>&1

cscript //E:javascript //NoLogo ListOutbox.js "My Samrtphone" "%USERPROFILE%\My Documents\smartphone\My Music" >playlist.bat

if not exist "%USERPROFILE%\My Documents\smartphone\My Music" mkdir "%USERPROFILE%\My Documents\smartphone\My Music"

erase /Q "%USERPROFILE%\My Documents\smartphone\My Music\*.*" >nul 2>&1

call playlist.bat

erase playlist.bat >nul 2>&1

echo #EXTM3U > MusicMix.m3u"

echo #EXTINF:154, >> MusicMix.m3u"

dir /b /o:-d "%USERPROFILE%\My Documents\smartphone\My Music" >> MusicMix.m3u

move MusicMix.m3u "%USERPROFILE%\My Documents\smartphone\My Music"

echo My Podcasts

cscript //E:javascript //NoLogo ListOutbox.js "My Podcasts" "%USERPROFILE%\My Documents\StorageCardBackup\My Podcasts" >playlist.bat

if not exist "%USERPROFILE%\My Documents\StorageCardBackup\My Podcasts" mkdir "%USERPROFILE%\My Documents\StorageCardBackup\My Podcasts"

erase /Q "%USERPROFILE%\My Documents\StorageCardBackup\My Podcasts\*.*" >nul 2>&1

call playlist.bat

erase playlist.bat >nul 2>&1

echo #EXTM3U > Podcasts.m3u"

echo #EXTINF:254, >> Podcasts.m3u"

dir /b /o:-d "%USERPROFILE%\My Documents\StorageCardBackup\My Podcasts" >> Podcasts.m3u

move Podcasts.m3u "%USERPROFILE%\My Documents\StorageCardBackup\My Podcasts"

echo My Videos

cscript //E:javascript //NoLogo ListOutbox.js "My Videos" "%USERPROFILE%\My Documents\My iTunes Videos" >playlist.bat

if not exist "%USERPROFILE%\My Documents\StorageCardBackup\My Videos" mkdir "%USERPROFILE%\My Documents\My iTunes Videos"

erase /Q "%USERPROFILE%\My Documents\My iTunes Videos\*.*" >nul 2>&1

erase /Q "%USERPROFILE%\My Documents\StorageCardBackup\My Videos\*.*" >nul 2>&1

call playlist.bat

erase playlist.bat >nul 2>&1

echo Convert Video format

for %%x in ("%USERPROFILE%\My Documents\My iTunes Videos\*.*") do "C:\Program Files\3GP_Converter034\3GP_Converter.exe" "%%x"

echo #EXTM3U > Videos.m3u"

echo #EXTINF:254, >> Videos.m3u"

dir /b /o:-d "%USERPROFILE%\My Documents\StorageCardBackup\My Videos" >> Videos.m3u

move Videos.m3u "%USERPROFILE%\My Documents\StorageCardBackup\My Videos"

-------------------------------------------------------------------------------------

LISTOUTBOX.JS - cut, past and save!

/*

File: ListOutbox.js

*/

var today = new Date();

var MSSFolder = WScript.Arguments(0);

var OUTFolder = WScript.Arguments(1);

var iTunesApp = WScript.CreateObject("iTunes.Application");

var mainLibrarySource = iTunesApp.LibrarySource;

var playlists = mainLibrarySource.Playlists;

var currPlaylist = playlists.ItemByName(MSSFolder);

var Months = new Array("01","02","03","04","05","06","07","08","09","10","11","12");

if (currPlaylist == undefined)

{

WScript.Echo("Play list '" & MSSFolder & "' does not exist.");

iTunesApp.CreatePlaylist(MSSFolder);

WScript.Echo("Play list '" & MSSFolder & "' created.");

}

else

{

var currTracks = currPlaylist.Tracks;

var numPlaylists = currTracks.Count;

var i=1;

while (numPlaylists != 0)

{

var currTrack = currTracks.Item(i);

WScript.Echo("copy /Y \"" + currTrack.Location + "\" \"" + OUTFolder + "\" >nul 2>&1");

numPlaylists--;

currTrack.PlayedCount = currTrack.PlayedCount + 1;

if (today.getDate() < 10)

{

currTrack.PlayedDate = "0" + today.getDate() +"/" + Months[today.getMonth()] + "/" + today.getYear() + " 12:00:00";

}

else

{

currTrack.PlayedDate = today.getDate() +"/" + Months[today.getMonth()] + "/" + today.getYear() + " 12:00:00";

}

i++;

}

}

--------------------------------------------------------------------------------------------------

Although TCPMP can play most audio & video formats, some videos have a frame/rate and size much higher than that required for viewing on a small smartphone screen.

I therefore use 3gpConverter to re-encode them to mpeg format - this runs from the batch file just set the options in 3gpConverter to exit after encoding and specify output directory and format.

3gpconverter can be obtained from http://www.nurs.or.jp/%7Ecalcium/3gpp/3GP_Converter034.zip

I then create a shortcut on my desktop to the batchfile and clicking this gets all the music from iTunes to a folder on my PC ready for copying to my smartphone.

I gave up trying to use Activesync - its slow and due to the auto sync every 5 minutes bug, is pron to disconnect when copying large numbers of files and now remove the SD card and copy them directly - much quicker and reliable.

TCPMP will not play purchased media from iTunes, but this can be converted. See this article http://en.wikipedia.org/wiki/QTFairUse

I now have new music and videos on my smartphone each day with just a couple of mouse clicks.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.