Page 1 of 11
Export to iTunes
Posted: Mon Jul 20, 2009 4:53 am
by markstuartwalker
I created this script as a work around for losing iPhone 3.0 sync capability im MM 3.1.
http://www.mediamonkey.com/forum/viewto ... &start=120
Basically it exports the selected playlist into iTunes and then triggers the iTunes sync function. iTunes 8.2 supports the iPhone 3.0 (of course). It some ways this is a retrograde step as it adds another level between MM and my iPhone but the iTunes layer is pretty transparent.
http://rapidshare.com/files/257883820/E ... .mmip.html
The implementation uses the COM interface into iTunes which Apple seem apply to publish and maintain so it would seem more worthwhile to pursue rather than repeatedly chase the ever evolving iTunes DB format.
Is this worth pursuing? I'm thinking of adding
* Options page for miscellaneous settings (autosync, path separator etc)
* Playlists in iTunes page to view what is currently synchronised and allow removal of playlists
* Playcount synchronisation
All versions can be found at
http://www.mediafire.com/?sharekey=b7ee ... 6e282a0ee8
Comments welcome.
Mark
Re: Export to iTunes
Posted: Mon Jul 20, 2009 5:17 am
by nynaevelan
This is something that I would not mind using but not for the iphone syncronization, so if possible could it be user configurable whether the sync is triggered in itunes, and of course playcounts are very important. My son prefers itunes so on a weekly basis I use the
export to itunes xml script to export the library but due to the limitations of itunes, I have to wipe the library each time before running it and it does not offer any controls over what is exported.
Nyn
Re: Export to iTunes
Posted: Mon Jul 20, 2009 5:26 am
by markstuartwalker
There is a single line in the script that triggers the synchronisation. Delete the line and it's perfect for you.
This was one of the switches that I was going to add to the options page.
Re: Export to iTunes
Posted: Mon Jul 20, 2009 7:23 am
by nynaevelan
This is the change I made, is this correct??
Code: Select all
'sub sync
' initProgress "Synchronising", 0
' iTunesApp.UpdateIPod
'end sub
Nyn
Re: Export to iTunes
Posted: Mon Jul 20, 2009 7:45 am
by markstuartwalker
Perfect
Re: Export to iTunes
Posted: Mon Jul 20, 2009 7:47 am
by markstuartwalker
Whoops! This is correct
sub sync
' initProgress "Synchronising", 0
' iTunesApp.UpdateIPod
end sub
Re: Export to iTunes
Posted: Mon Jul 20, 2009 8:05 am
by nynaevelan
Yes that worked, and you are right, once the playcounts are added this will work perfectly. One little thing, this is not a major concern but I have my playlists nested within playlists and when they are exported to itunes they include the parent playlist in the title, can this be changed? If not, don't worry about it, I can live with it.
Nyn
Re: Export to iTunes
Posted: Mon Jul 20, 2009 1:55 pm
by markstuartwalker
Strangely, the parent folder names were added as a request of someone else.
Try this slight modification in the code ...
function getFullMmName( tree, node )
dim n : n = node.caption
getFullMmName = n
end function
... pretty soon you'll have rewritten it all.
Re: Export to iTunes
Posted: Mon Jul 20, 2009 2:01 pm
by nynaevelan
I'm a little confused, am I commenting out all the lines between those sections?? These lines here:
Code: Select all
dim i : for i = 1 to 10
set p = tree.ParentNode(p)
if p is nothing then exit for
if p.caption = "" then exit for
if p.caption = "Playlists" then exit for
if p.caption = "Imported m3u playlists" then exit for
n = p.Caption + dirSeparator + n
next
Re: Export to iTunes
Posted: Mon Jul 20, 2009 3:49 pm
by markstuartwalker
Yes
Re: Export to iTunes
Posted: Mon Jul 20, 2009 4:35 pm
by nynaevelan
Works perfectly, now I will
patiently wait for you to add the ability to sync playcounts.

Out of curiosity what are the zzz playlists for?
Nyn
Re: Export to iTunes
Posted: Tue Jul 21, 2009 4:00 pm
by codecrafter
Mark,
The script fails in copyPlaylist() at 'Set os = p2.AddFile(p1.tracks.item(j).path)' if processing a .wma file. Other non-iPhone playable files will probably also fail.
For a hack to skip .wma files, add if/end if statements:
Code: Select all
if not right(p1.tracks.item(j).path, 4) = ".wma" then
Set os = p2.AddFile(p1.tracks.item(j).path)
if not os is nothing then
While os.InProgress
Wend
end if
countProgress
end if
Does anyone know if it's possible to do a 'Convert Track Format' from a script? Other threads seem to indicate no. It would be nice to find some way to get autoconversion in the loop so that this script will work more like syncing to the iPhone used to work.
Also, I wonder if
http://www.mediafire.com would be a better home for the script than rapidshare (to avoid the download limit).
Re: Export to iTunes
Posted: Wed Jul 22, 2009 7:11 am
by markstuartwalker
Yes, thanks for the bugfix and the Mediafire hint.
Here is 2.1 again
http://www.mediafire.com/?sharekey=b7ee ... f6e8ebb871
It has been pointed out elsewhere about the file format compatibility. In the future I shall modify the script to transfer only mp3 files as a bit of self-protection. auto-convertion might come in a much later version.
Mark
Re: Export to iTunes
Posted: Wed Jul 22, 2009 7:48 am
by m1abrams
codecrafter wrote:
Does anyone know if it's possible to do a 'Convert Track Format' from a script? Other threads seem to indicate no. It would be nice to find some way to get autoconversion in the loop so that this script will work more like syncing to the iPhone used to work.
Also, I wonder if
http://www.mediafire.com would be a better home for the script than rapidshare (to avoid the download limit).
Well the iTunes API does have liTunes::ConvertFile2() method so it does look possible. I have not written anything that uses this method though. Note you will only be able to convert to formats that iTunes supports obviously and the encoders/decoders that iTunes has access to. It means you should be able to convert from ALAC to AAC, but you would not be able to go from FLAC to MP3.
Re: Export to iTunes
Posted: Wed Jul 22, 2009 10:28 am
by nynaevelan
markstuartwalker wrote:Yes, thanks for the bugfix and the Mediafire hint.
Here is 2.1 again
http://www.mediafire.com/?sharekey=b7ee ... f6e8ebb871
It has been pointed out elsewhere about the file format compatibility. In the future I shall modify the script to transfer only mp3 files as a bit of self-protection. auto-convertion might come in a much later version.
Mark
Other than the bugfix, what other changes are in version 2.1??
Nyn