Community Forums Archive

Go Back

Subject:Help needed! create/extract/rename scripting
Posted by: Audiomigration
Date:6/11/2007 12:33:12 AM

I work @ Swedish Centre for Audio migration (Sveriges Ljudmigreringscentrum) and i'm trying to make our digitization process more effective and have just started to look in to scripting.

I want to create regions from markers, placed during recording, rename these region so that they say 01, 02, 03 etc and not "Region 00:00:13,746 to 00:01:19,505 (01 - 02)" etc.

I've configured an existing script (create regions and extract), now i need some help with the naming of the regions. How can i generate the region name to 01, 02, 03 etc? is there a rename funktion i can call upon?

I really hope you can help me with this problem

Best Regards
Jonas Berg

Subject:RE: Help needed! create/extract/rename script
Reply by: _TJ
Date:6/12/2007 12:09:27 PM

This code snippet will rename all of the markers in the current file to "01", "02", etc.

int id = 1;
foreach (SfAudioMarker mk in app.CurrentFile.Markers)
{
mk.Name = String.Format("{0:d2}", id);
++id;
}

tj

Subject:RE: Help needed! create/extract/rename script
Reply by: Audiomigration
Date:6/19/2007 7:07:29 AM

Hey TJ,

Many many thanks for your help, It really did the trick.

Great work!!

Go Back