Export to iTunes

Download and get help for different MediaMonkey Addons.

Moderators: Peke, Gurus

markstuartwalker
Posts: 931
Joined: Fri Jul 10, 2009 8:10 am

Export to iTunes

Post by markstuartwalker » Mon Jul 20, 2009 4:53 am

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
Last edited by markstuartwalker on Sun Aug 02, 2009 12:07 pm, edited 1 time in total.
Windows 7,8 / Ubuntu 13.10 / Mavericks 10.9 / iOS 7.1 / iTunes 11.1
iTunes plugin (d_itunes & itunes4) http://www.mediamonkey.com/forum/viewto ... =2&t=45713
Running MM under Mac OS X with Wine http://www.mediamonkey.com/forum/viewto ... =4&t=58507

nynaevelan
Posts: 5559
Joined: Wed Feb 07, 2007 11:07 pm
Location: New Jersey, USA
Contact:

Re: Export to iTunes

Post by nynaevelan » Mon Jul 20, 2009 5:17 am

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
3.2x - Win7 Ultimate (Zen Touch 2 16 GB/Zen 8GB)
Link to Favorite Scripts/Skins

Join Dropbox, the online site to share your files

markstuartwalker
Posts: 931
Joined: Fri Jul 10, 2009 8:10 am

Re: Export to iTunes

Post by markstuartwalker » Mon Jul 20, 2009 5:26 am

There is a single line in the script that triggers the synchronisation. Delete the line and it's perfect for you. :D

This was one of the switches that I was going to add to the options page.
Windows 7,8 / Ubuntu 13.10 / Mavericks 10.9 / iOS 7.1 / iTunes 11.1
iTunes plugin (d_itunes & itunes4) http://www.mediamonkey.com/forum/viewto ... =2&t=45713
Running MM under Mac OS X with Wine http://www.mediamonkey.com/forum/viewto ... =4&t=58507

nynaevelan
Posts: 5559
Joined: Wed Feb 07, 2007 11:07 pm
Location: New Jersey, USA
Contact:

Re: Export to iTunes

Post by nynaevelan » Mon Jul 20, 2009 7:23 am

This is the change I made, is this correct??

Code: Select all

'sub sync

 '   initProgress "Synchronising", 0
  '  iTunesApp.UpdateIPod    

'end sub 
Nyn
3.2x - Win7 Ultimate (Zen Touch 2 16 GB/Zen 8GB)
Link to Favorite Scripts/Skins

Join Dropbox, the online site to share your files

markstuartwalker
Posts: 931
Joined: Fri Jul 10, 2009 8:10 am

Re: Export to iTunes

Post by markstuartwalker » Mon Jul 20, 2009 7:45 am

Perfect

markstuartwalker
Posts: 931
Joined: Fri Jul 10, 2009 8:10 am

Re: Export to iTunes

Post by markstuartwalker » Mon Jul 20, 2009 7:47 am

Whoops! This is correct

sub sync

' initProgress "Synchronising", 0
' iTunesApp.UpdateIPod

end sub
Windows 7,8 / Ubuntu 13.10 / Mavericks 10.9 / iOS 7.1 / iTunes 11.1
iTunes plugin (d_itunes & itunes4) http://www.mediamonkey.com/forum/viewto ... =2&t=45713
Running MM under Mac OS X with Wine http://www.mediamonkey.com/forum/viewto ... =4&t=58507

nynaevelan
Posts: 5559
Joined: Wed Feb 07, 2007 11:07 pm
Location: New Jersey, USA
Contact:

Re: Export to iTunes

Post by nynaevelan » Mon Jul 20, 2009 8:05 am

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
3.2x - Win7 Ultimate (Zen Touch 2 16 GB/Zen 8GB)
Link to Favorite Scripts/Skins

Join Dropbox, the online site to share your files

markstuartwalker
Posts: 931
Joined: Fri Jul 10, 2009 8:10 am

Re: Export to iTunes

Post by markstuartwalker » Mon Jul 20, 2009 1:55 pm

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.
Windows 7,8 / Ubuntu 13.10 / Mavericks 10.9 / iOS 7.1 / iTunes 11.1
iTunes plugin (d_itunes & itunes4) http://www.mediamonkey.com/forum/viewto ... =2&t=45713
Running MM under Mac OS X with Wine http://www.mediamonkey.com/forum/viewto ... =4&t=58507

nynaevelan
Posts: 5559
Joined: Wed Feb 07, 2007 11:07 pm
Location: New Jersey, USA
Contact:

Re: Export to iTunes

Post by nynaevelan » Mon Jul 20, 2009 2:01 pm

:lol: :lol:

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 
3.2x - Win7 Ultimate (Zen Touch 2 16 GB/Zen 8GB)
Link to Favorite Scripts/Skins

Join Dropbox, the online site to share your files

markstuartwalker
Posts: 931
Joined: Fri Jul 10, 2009 8:10 am

Re: Export to iTunes

Post by markstuartwalker » Mon Jul 20, 2009 3:49 pm

Yes
Windows 7,8 / Ubuntu 13.10 / Mavericks 10.9 / iOS 7.1 / iTunes 11.1
iTunes plugin (d_itunes & itunes4) http://www.mediamonkey.com/forum/viewto ... =2&t=45713
Running MM under Mac OS X with Wine http://www.mediamonkey.com/forum/viewto ... =4&t=58507

nynaevelan
Posts: 5559
Joined: Wed Feb 07, 2007 11:07 pm
Location: New Jersey, USA
Contact:

Re: Export to iTunes

Post by nynaevelan » Mon Jul 20, 2009 4:35 pm

Works perfectly, now I will patiently wait for you to add the ability to sync playcounts. :wink: Out of curiosity what are the zzz playlists for?

Nyn
3.2x - Win7 Ultimate (Zen Touch 2 16 GB/Zen 8GB)
Link to Favorite Scripts/Skins

Join Dropbox, the online site to share your files

codecrafter
Posts: 5
Joined: Sun Dec 16, 2007 3:20 pm

Re: Export to iTunes

Post by codecrafter » Tue Jul 21, 2009 4:00 pm

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).

markstuartwalker
Posts: 931
Joined: Fri Jul 10, 2009 8:10 am

Re: Export to iTunes

Post by markstuartwalker » Wed Jul 22, 2009 7:11 am

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
Windows 7,8 / Ubuntu 13.10 / Mavericks 10.9 / iOS 7.1 / iTunes 11.1
iTunes plugin (d_itunes & itunes4) http://www.mediamonkey.com/forum/viewto ... =2&t=45713
Running MM under Mac OS X with Wine http://www.mediamonkey.com/forum/viewto ... =4&t=58507

m1abrams
Posts: 43
Joined: Wed Feb 22, 2006 9:43 pm

Re: Export to iTunes

Post by m1abrams » Wed Jul 22, 2009 7:48 am

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.

nynaevelan
Posts: 5559
Joined: Wed Feb 07, 2007 11:07 pm
Location: New Jersey, USA
Contact:

Re: Export to iTunes

Post by nynaevelan » Wed Jul 22, 2009 10:28 am

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
3.2x - Win7 Ultimate (Zen Touch 2 16 GB/Zen 8GB)
Link to Favorite Scripts/Skins

Join Dropbox, the online site to share your files

Post Reply