New Version: Copytags 2.2 (2008-07-18) [MM3]

Download and get help for different MediaMonkey Addons.

Moderators: Peke, Gurus

Maaspuck
Posts: 155
Joined: Thu Dec 28, 2006 4:41 am
Location: Hamburg, Germany

New Version: Copytags 2.2 (2008-07-18) [MM3]

Post by Maaspuck » Fri Mar 09, 2007 5:49 pm

Hi all,

i've updated my script to version 2.2. Please have a look at the changelog below for the changes in this version. Main improvement is the support of the new MM3 tags including custom4 and custom5 for example.

This is how it works:
- install the script as described in the header og the text file
- during startup of the MediaMonkey it will create a submenufolder 'CopyTags' with five options in it. Each of them can be invoked via menu or by pressing CTRL+1, 2, 3, 4 or 5.
- CTRL+1 invokes a user window which offers the same function like pressing CTRL+2, 3 or 4. Additionally there is the possibility to delete are cache files in the cache folder (see below) by pressing CTRL+5

Copying tag information:
- Select a list of files in your MediaMonkey List and press 'CTRL+2'. All tag information of the selected files are copied into a textfile named 'CopyPasteTags.txt' created in the subfolder 'CopyTags' of the MM\scripts-folder. If one of the selected files contains albumart, the pictures are also stored in this folder using a special file identification system.

Pasting tag information:
- Select a list of files in your MediaMonkey List and press 'CTRL+3'. The script opens the 'CopyPasteTags.txt' just created before, reads line per line and stores the tag and picture information in arrays.
- if the corresponding option is set, you will now get a new window with two lists where you can see the order of the source and the destination files. You also can move the destination files up and down via drag and drop and thus change the copy order.
- Depending on the number of source or destination files, in order to get a better overview, all files, which will not used as a tag source or which won't be changed (destination), will also be listed.
- It's possible to select the tags which shall be copied to the destination files. This information is permanently stored in another textfile called 'CopyPasteTags.ini'.

- After initiating the copy process you may be asked for a backup of the original files, if the corresponding option is set. They will be copied to a subdirectory named 'CopyTags Original Backup'.

- If you press CTRL+4 instead of CTRL+3, the script will also copy tag information to a selection of files. But in this case only the first tag information of the CopyPasteTags.txt is copied to all selected files. As it doesn't make sence, some tags are left out in this case (song name, track order and last played). You also will not be able to change the order of the destination files.

Changelog:

Changes since 2.1
- Added: Support for MM3 Tags
- Added: Option to allow or disallow the mainwindow refresh after copy process
- Fixed: Checkbox 'Delete images in destination files' in the file window works correct now


Changes since 2.0
- Changed: Drag and drop now works better with DragOverEvent instead of MouseUp, MouseMove and MouseDown (Thanks to jsg)
- Fixed: Drag and drop now works with lists longer than the visible window area

Changes since 1.12
- Added: Showing FileBox in PasteMode was added as an option
- Added: Deleting AlbumArt in target files was added as an option
- Added: Tag selection was added as an option
- Added: Tag combination can be saved as one of 20 presets
- Fixed: [CopyPasteTags] Section in inifile is generated at application start now
- Added: Drag and Drop functionality in right ListView when paste mode is active

Changes since 1.10
- Database is updated also for AlbumArt entries
- Copying AlbumArt now works with built in MediaMonkey functions
- Pasting is much faster now as wait.vbs is no longer needed

Changes since 1.9
- Option "Delete images in destination files" set to False as default
- Database is updated, if song is in Database (ID>0)
- fixed: no error occurs, when SDB.Player.CurrentSong is empty
- addded OptionSheet for the script

Changes since 1.8
- fixed: Call of 'wait.vbs' no longer opens associated applications but only the Windows scripting host (Thanks To Steegy For the fixed code)
- fixed: script error occurs when writing a 'png' file twice to the same file
- added: images in destination files can be deleted now before writing new ones
- fixed: seems to work now even with MM3
- AlbumArt tag copying set to non-default (not important for most user)
- code optimisation

Changes since 1.7
- new Menu item 'clear cache Ctrl+5' added
- wait.vbs not found error fixed (probably)
- added all songs in source or destination, files which won't be used or changed, are in light grey

Changes since 1.6
- Support for the BPM tag (it seems that I forgot this before)
- Keyboard shortcuts should work now for international installations
- code optimisations

Changes since 1.4
- new window showing the order of source and destination files
- order of destination files can be changed
- tags to be copied can be selected and permanently saved
- tagging Albumart seems to work now.
- the nasty 'Confirm' dialog was removed

Changes since 1.3
- the script asks for making a backup of the original files
- you can now paste the tag information of one file to a lot of others (CTRL+4)

Changes since 1.2 beta
- the section for the scripts.ini was removed
- during autostart the scripts adds a submenu in the scripts-menu
- Main dialog, Copy Routine and Paste Routine can be called via CTRL+1, CTRL+2 and CTRL+3
- All text tags are written to the target file. Before including the pictures a subdirectory for backup files will be created. Backup and target files are no longer in the same directory
- a progress bar was added
- code optimisation

Changes since 1.0 beta
- more tags are supported now
- all possible picture types (jpg, png, bmp, gif) are supported now
- code optimisation

Regards

Maaspuck

You can get the code here.
Last edited by Maaspuck on Fri Jul 18, 2008 5:18 pm, edited 29 times in total.

judas
Posts: 572
Joined: Thu Jun 02, 2005 11:26 pm
Location: Bogotá, Colombia

Post by judas » Sun Mar 11, 2007 12:00 pm

nice script! it had been requested several times and i believe no one had done it...im pretty sure that with the help of the scrpiting gurus that we have in this forum you'll solve the problems.
Cheers, judas

oldies collector
Posts: 15
Joined: Tue Jul 04, 2006 9:49 am

copy tags

Post by oldies collector » Tue Mar 13, 2007 3:34 pm

Hooray! Yippee! Huzzah!!
I'm the same as you and have spent way too much time re-tagging "updated" files. This script is gonna save my fingers a lot of walking.

Kudus and thanks.

Maaspuck
Posts: 155
Joined: Thu Dec 28, 2006 4:41 am
Location: Hamburg, Germany

New Version Copytags 1.0 beta

Post by Maaspuck » Tue Mar 13, 2007 3:55 pm

Hi scripters and users,

after several hours of hard work I found a solution to include pictures in mp3 files by vbscript while copying tags from several selected files in MediaMonkey. I would like to describe my method shortly, you will find the script below. But please keep in mind, this script is still beta, so test it with backup files.

- Main function is already described above in my first post.
- After tagging the text information (artist, title, year etc.) using MediaMonkey's included functions a backup copy of the new mp3 file is made.
- A new file named as the original mp3-file is created and while copying the information of the backup file the ID3 Header in the file is updated and picture data is included. After filling in the picture data the remaining ID3-Data is copied follow by the raw mp3 data.
- What you get is a mp3-file with new tags and embedded pictures

Even though this script seems to work tehre are some disadvantages.
The most disappointing thing is that the messagebox I included while inserting picture data seems to be necessary as the windows file system will corrupt files if this messagebox is disabled. I do not know why this happens.
- At the moment only jpg files are supported
- I would like to include more flexibility concerning the tags to be copied
- I want to delete pictures before including new ones
- I want to include keyboard shortcuts like CTRL-C and CTRL-V
- ...

Thx to all scripters (especially trixmoto, LowLander, Steegy, Bex and onkel_enno) for their knowledge, cool scripts, ideas and opinions. All this helped me to write my first vbscript at all. I apologize for all programming errors I made.

And here is the new script. Please test it (probably with backup files first) and post your opinions, suggestments and improvements.

Maaspuck

Code: Select all

Code removed [2007-03-17]
Last edited by Maaspuck on Sat Mar 17, 2007 12:01 pm, edited 1 time in total.

Bex
Posts: 6316
Joined: Fri May 21, 2004 5:44 am
Location: Sweden

Post by Bex » Tue Mar 13, 2007 5:03 pm

Nice work! It's cool that you have taken the step into the scripting world. As you see i takes quite a while to accomplish what one want. I hope the upcoming script wiki will shorten the learning curve. I myself has learned a lot but still has plenty left to learn with VBScript.

Regarding the script, which is since a long time wanted one, I've been thinking of implement something similar in my Duplicate script but have decided to wait until 3.0.

You could also consider to implement database only values such as PlayHistory, PlayCount, DateAdded and Playlist entries. It requires SQL and one way of doing it is in my duplicate script. Fell free to copy whatever you want from it.

PS thanks for the note.

/Bex
Advanced Duplicate Find & Fix Find More From Same - Custom Search. | Transfer PlayStat & Copy-Paste Tags/AlbumArt between any tracks.
Tagging Inconsistencies Do you think you have your tags in order? Think again...
Play History & Stats Node Like having your Last-FM account stored locally, but more advanced.
Case & Leading Zero Fixer Works on filenames too!

All My Scripts

MCSmarties
Posts: 248
Joined: Tue Dec 06, 2005 8:01 pm

OH YES!!

Post by MCSmarties » Tue Mar 13, 2007 8:43 pm

i can't believe somebody's finally tackling the "copy tags" problem!!

Maaspuck, you're a hero! I've been positively DYING for a script like this.
Keep up the great work!!

Note: I'm assuming you only included a selection of fields for demonstration purposes?
Or is there a particular reason why Custom2, Custom3, Original.Year... are not part of the script?

You rock; thumbs way, way, up!

Maaspuck
Posts: 155
Joined: Thu Dec 28, 2006 4:41 am
Location: Hamburg, Germany

Thanks

Post by Maaspuck » Wed Mar 14, 2007 1:10 pm

Hi out there,

@MCSmarties:
well, thx a lot but i am not a hero, i just like coding. Dealing with bits and bytes started early about 20 years ago with 6502 assembler and 68000 assembler and GFA Basic. But vbscript was new for me.

Yes, you're almost right, i included the tags especially for my personal purposes but i plan to also include other tag information. Maybe this could be done with the help of a comfortable user interface where you can choose the tags you want to copy... let's wait for the next versions.

@Bex:
Including database entries as you proposed is a nice idea, i will think about it. My first purpose for this script was to paste the copied tags to files not yet loaded into database and just move the newer files to the same place where the old files of poor quality have been (i think this is not really good english, but anyway) via Auto Organize function. As the filename and therefore database entry will remain the same, also the database entries should be still in the database. So could it be, that they don't have to be copied then?

Regards

Maaspuck

Maaspuck
Posts: 155
Joined: Thu Dec 28, 2006 4:41 am
Location: Hamburg, Germany

New Update: Version 1.4 (2007-03-20)

Post by Maaspuck » Tue Mar 20, 2007 4:46 pm

Hi all,

i've updated the script. Please read the first post in this thread.

Regards

Maaspuck

MCSmarties
Posts: 248
Joined: Tue Dec 06, 2005 8:01 pm

Post by MCSmarties » Tue Mar 20, 2007 7:49 pm

Thanks for the new version, Maaspuck.
A very promising development! Essentially it works - it does copy the information - but I found several things that need to be fixed:

- the script should not modify the FILENAME (it's really difficult to identify the corresponding file afterwards, specially if things go wrong)
- currently only really works if you choose ONE file at a time. If you choose several, the order is very easy to get mixed up. For instance, if you select "Song A" and "Song B" out of a list and then pick two target files, it will tag the first song with "Song A" and the second one with "Song B" - there's no control. Tricky to discribe, I hope you see what I mean.
- some fields are not copied yet (I noticed BPM and last time played, there are probably others)

IMO it's an absolute necessity to be able to select the SOURCE and TARGET for a particular file at the same time (get a dialog window with two columns - all source files on the left and a "browse" button to select the corresponding target for each of them on the right).

In a later stage, the script could automatically search in a specified directory for the most LIKELY target based on file name similarity - but the user must always be able to override that choice!!

From your "to do" list, I think the possibility to select the tags to be copied is the most important. Maybe Steegy can help you on that one, based on his excellent "Switch or copy fields" script?

The ability to copy pictures is great but I don't think you should worry all that much about improving this aspect. It's one of the easiest things to copy over, thanks to the existing "apply to entire album" button. Just my 2c...

Finally, a way to select a song pair and compare each field side by side (like a mini-browser?) would be awesome!

One of the things that work flawlessly and is particularly nice is the backup feature. Of course I made sure to backup my entire collection of songs first, but the "safeguards" included in your script work just fine. Cool!

Keep up the great work, you're definitely on the right track!!

Maaspuck
Posts: 155
Joined: Thu Dec 28, 2006 4:41 am
Location: Hamburg, Germany

Thanks

Post by Maaspuck » Wed Mar 21, 2007 12:46 pm

Hi McSmarties,

thank you very much for the long and detailed informationand opinion about the script. This really helps me to focus on the right things during further development steps.

Here are some comments:
- changing of the filename could be an option for the user
- yes, i agree with you. Copying the right tags to the right files is the most important thing and should be much easier and more safe than now. Especially if the target list depends on the click order. I probably should focus on this at first.
- Yes, not all fields are copied right now. This is just due to my lack knowledge about the meaning of some of them. But this can easily be changed. I will remove the comment character (" ' ") in the copy and in the paste sub and it should work then.
- A 2 column dialog for changing Source and destination would be great. I am thinking of a solution where are files, which were already copied and saved in the 'CopyPasteTags.txt' (fortunately including filename) on the left side and the actual selection on the right. Maybe it is possible to change the order on the right side then. Together with a possibility to select the tags to be copied it probably would be much better than now.
- Automatic search of the right file.... seems to be very challenging...

Let's wait for the future versions...

Again, thanks for your answer

Regards

Maaspuck

MCSmarties
Posts: 248
Joined: Tue Dec 06, 2005 8:01 pm

Post by MCSmarties » Fri Mar 23, 2007 10:31 am

Glad you appreciated my comments. I'm not much of a coder - scrap that, I'm NOT a coder - but I can be a royal pain-in-the-butt beta tester! :lol:

By the way, did you see that Risser is working on the same problem with a script of his own? Maybe you two should think about pairing up?

You're approaching the same subject from different angles, with specific advantages and problems, so a mix of both is bound to make an awesome script... just my 2c.

Unless of course both of you prefer the stimulus of fierce competition! :D

Maaspuck
Posts: 155
Joined: Thu Dec 28, 2006 4:41 am
Location: Hamburg, Germany

New Update: Version 1.6 (2007-04-01)

Post by Maaspuck » Sun Apr 01, 2007 12:03 pm

Hi all,

i've updated the script. Please read the first post in this thread.

Regards

Maaspuck

kdo
Posts: 61
Joined: Mon Mar 26, 2007 6:23 pm
Location: Russia

Post by kdo » Sun Apr 01, 2007 6:07 pm

I get error message:

...MS VBscript runtime error...bla-bla... 'Object required: FSO'

Do I need to install/update some library?

(This would be a really awesome script!)

Maaspuck
Posts: 155
Joined: Thu Dec 28, 2006 4:41 am
Location: Hamburg, Germany

error message

Post by Maaspuck » Mon Apr 02, 2007 4:22 pm

Hi kdo,

I added a 'Dim FSO' in line 248 and it seems to work now. The new code can be copied from my first post in this thread.

Another issue not working at the moment are the keyboard shortcuts. It's working great for german installations but i have to correct this for international installations. Sorry for this.

I also encountered some problems with the beta version of MM3. So I decided to make this script a MM2 only script at the moment.

Regards

Maaspuck

Bex
Posts: 6316
Joined: Fri May 21, 2004 5:44 am
Location: Sweden

Post by Bex » Mon Apr 02, 2007 5:20 pm

Maaspuck!

I just want to give you credit for all the work you put into this script.
Keep it up!

/Bex
Advanced Duplicate Find & Fix Find More From Same - Custom Search. | Transfer PlayStat & Copy-Paste Tags/AlbumArt between any tracks.
Tagging Inconsistencies Do you think you have your tags in order? Think again...
Play History & Stats Node Like having your Last-FM account stored locally, but more advanced.
Case & Leading Zero Fixer Works on filenames too!

All My Scripts

Post Reply