Tg_GetRowCount
-
- Newbie
- Posts: 3
- Joined: Sun May 01, 2016 8:18 pm
Tg_GetRowCount
I am using this mainly to rename and tag audiobook files, in the format 'Book name - 01 of 32'. The obvious way to get the file count is to use the variable tg_GetRowCount, but I cannot work out how to do this. Are there any useful guides on scripting? Or can anyone help with this problem please?
Re: Tg_GetRowCount
Here is an example of a basic script that you can use:
It can be easily modified to your exact needs just let me know how it works for you
Code: Select all
program ab_rename;
var
sTmp, sName: string;
i: integer;
begin
if not tg_Init then exit; // no rows get out
i := 1;
sName := InputBox( 'Type Name', 'Book name', 'Book name' );
repeat
sTmp := sName + ' - ' +
PadLeft( IntToStr( i ), 2, '0' ) + ' of ' +
PadLeft( IntToStr( tg_GetRowCount ), 2, '0' );
tg_setField( 'Rename', sTmp );
until not tg_Skip;
end.
-
- Newbie
- Posts: 3
- Joined: Sun May 01, 2016 8:18 pm
Re: Tg_GetRowCount
Thanks for your help with this JTClipper. I tweaked your code and got just what I needed. I did need to increment the counter though with:
i := i + 1;
The ease of this has opened up many more possibilities, and I will be experimenting over the next few days to make my tagging easier.
i := i + 1;
The ease of this has opened up many more possibilities, and I will be experimenting over the next few days to make my tagging easier.
