How to retrieve a sample file length [Solved]

Hi.

Is there a way to retrieve a sample file length of the currently loaded sample of a sample zone?

I’m trying to create a script to replace sample by changing the “SampleOsc.Filename” parameter and I’d like to set the SampleEnd parameter to the full length of the sample.

Any ideas?

Edit: AudioFile - HALion Script - Steinberg Developer Help

Thanks Matthias.