Page 1 of 1
Use environment variables in the audacity.cfg file?
Posted: Thu Dec 23, 2010 1:15 pm
by semo
I need to set audacity to default to certain directories (i.e. not going to the program files when you go to File --> Open for the first time).
For example I'm trying to do something like this:
TempDir=%TMP%audacity_temp
PresetsDir=%APPDATA%RoamingAudacitypresets
DefaultOpenPath=%HOMEDRIVE%My Music
As far as I can understand, you can only use absolute paths which means I would have to use C# to generate the file once a user logs in and launches the app which is a bit beyond me (I can just about copy a template file to the user's roaming location).
Any suggestions?
Thanks
Re: Use environment variables in the audacity.cfg file?
Posted: Fri Dec 24, 2010 11:43 pm
by Gale Andrews
semo wrote:I need to set audacity to default to certain directories (i.e. not going to the program files when you go to File --> Open for the first time).
For example I'm trying to do something like this:
TempDir=%TMP%audacity_temp
PresetsDir=%APPDATA%RoamingAudacitypresets
DefaultOpenPath=%HOMEDRIVE%My Music
As far as I can understand, you can only use absolute paths which means I would have to use C# to generate the file once a user logs in and launches the app which is a bit beyond me (I can just about copy a template file to the user's roaming location).
Are you a network admin - is that why you need to force settings?
The user can set the temporary directory themselves in the Directories preferences, but it initialises by default to the directory you quote above anyway, so I don't know why you want to change it.
The PresetsDir also initialises by default to the directory you quote (on Vista/7). However I don't know offhand of any dialogue in Audacity that respects the PresetsDir in .cfg. FFmpeg custom export remembers the last used directory and other dialogues seem to always open in the user's Audacity data directory rather than the presets folder within that (irrespective of .cfg).
User can set the Open path themselves by opening a file - that directory will then always be used. Otherwise, Audacity Open path initialises to the app's working directory.
As a network admin you can write a script if you wish to modify your users' audacity.cfg when they log on (but yes I think the script will have to generate the required absolute path from the user's home directory). See if this information on
ExpandEnvironmentStrings method helps.
If you require user to launch Audacity when they log on, place a shortcut to audacity.exe in the users' startup folder.
Gale