Page 1 of 1

Posted: 12 Feb 2015, 16:24
by AndrewChi
Hello,
I need some help...
I am trying to save a random sample name and a text file with the same name.
This works, but I also need to extract the file name WITHOUT extension (.WAV and .TXT) later on to work with it in the patch.
the module 'extract file ext' extracts the extension,
but the module 'extract file name' gives you in fact the 'short filename' but it still has its extension.
Any ideas on how to really extract the file name, without its extension?

Any help appreciated, thanks!!!

Posted: 13 Feb 2015, 00:00
by senso
You can use this small script

Code: Select all

/////////////////////////////////////////////
// sub File Ext   
////////////////////////////////////////////

// parameters declaration
var input     : Tparameter;
var output    : Tparameter;



 // initialisation : create parameters
procedure init;
begin  
 SetModuleColor($808080+302060);
 Input := CreateParam('full file name',ptTextField);
 SetIsOutPut(Input,false);
 output := CreateParam('out',ptTextField);                                 
 SetIsInPut(Output,false);      
end;
                         

procedure Callback(n:integer);
begin               
 SetStringValue(Output,copy(GetStringValue(Input),1,length(GetStringValue(Input))-4));    
end;
Will be integrated in the next major release

Posted: 13 Feb 2015, 03:23
by AndrewChi
Great! Thank you very much for your fast reply Senso. Works perfect!!