Community Forums Archive

Go Back

Subject:Save As Arguments
Posted by: clmn
Date:1/3/2006 12:49:22 PM

What do you put for the arguments in this statement?

ForgeApp.CurrentFile.SaveAs("FileNAme","FormatNameorGUID",object VTEmplateNameOrDate,SoundForge.RenderOptions opt);

Subject:RE: Save As Arguments
Reply by: _TJ
Date:1/3/2006 8:22:36 PM

Well, you might use these


ForgeApp.CurrentFile.SaveAs(@"c:\myfile.wma", "Windows Media Audio V9", "160 Kbps Stereo Music", RenderOptions.RenderOnly);


"FileName" is the name that you want the file saved as
"FormatNameOrGUID" is the file type specified either by name or by unique identifier.
vTemplateNameOrData is the specific settings for that file type - either a preset/template name or the actual template data returned from a previous call to ChooseTemplate().
RenderOptions is one or more options from the RenderOptions enumeration.

Subject:RE: Save As Arguments
Reply by: GPD
Date:9/11/2007 1:34:59 PM

Question about the "FileName" argument:

Is it possible to seperate the file name from the directory path?

I would like to use a string for the file name. The string is defined using:

string strOutfile = String.Format(
"SFM {0} {1} {2} {3} .wav",
dpA, dpB dpC, 90 );

dpA, dpB, dpC are doubles defined elsewhere in the script. The above will write a string using parameters in the namespace as part of the file name.

The problem that I have is that I cannot put the file path into this string b/c of illegal characters : and
So:

string strOutfile = String.Format(
"c:\SFM {0} {1} {2} {3} .wav",
dpA, dpB dpC, 90 );

used with:

CurrentFile.SaveAs(@strOutfile, ...

is ilegal.

any help?

Subject:RE: Save As Arguments
Reply by: GPD
Date:9/12/2007 9:45:26 AM

I've figured it out:

It should be:


string strOutfile = String.Format(@"c:\SFM {0} {1} {2} {3} .wav",dpA, dpB dpC, 90 );

CurrentFile.SaveAs(strOutfile, ...


Message last edited on9/12/2007 9:45:51 AM byGPD.
Subject:RE: Save As Arguments
Reply by: _TJ
Date:9/12/2007 8:03:31 PM

that works. The @ before the string tells the compiler not to try and interpret the path separator characters \ as the prefix for a special character.

the other thing you can do is double up all of your \'s, without the @ before the string, the compiler will treat \\ as \, but will not generate an error

so this also works.

string strOutfile = String.Format("c:\\SFM {0} {1} {2} {3} .wav",dpA, dpB dpC, 90 );

Go Back