If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.
I have a batch process that converts WMAs to WAVs and want BC to afterwards delete any orphan WAVs. How do I code this as a standalone script i.e. not relying on a stored session?
You would need to create an Alignment Override as a session default to match *.wma and *.wav (or use a saved session, and then load a pair of folders):
load WMAtoWAVsession
load "c:\folder1wma" "c:\folder2wav"
expand all
select right.orphan.files
delete right
As with all script, I strongly recommend testing it on already backed up files or test files, since the delete may be permanent and not undo-able if it does not behave as you expect. This goes doubly true with the Alignment Override, since if it does not work as you expect, then all of your right files are potentially considered Orphans, and the script would delete **all** of them.
It's on our wishlist to add features to scripting.
Thanks.
Originally posted by Aaron
For now, however, you'll want to use a session.
Not at all. I cannot have scripts in projects dependent on registry content.
Originally posted by Aaron
Could you go into more detail on your workflow?
I have a project that needs to on different OS installations. It includes portable BC.
Originally posted by Aaron
Is there a technical hurdle that stops you from using the saved session?
Sure - that BC insists such goes in the registry rather than in my project folder.
I am sure there are many developers here with the same requirements i.e. to be able to restore a project by folder restore, without altering the registry. I'd like to hear how they manage to use BC sessions in such projects' scripts.
BC3 does not store Session settings in your registry. By default, we store all session information in the BCSessions.xml file. This file will be located in your %AppData% directory for a normal installation, or in the program directory (next to BCompare.exe) in a Portable install. You can browse directly to these files from the Help menu -> Support, and click the blue link to Explore Settings Folder.
A Portable install is designed to store and contain all information in the portable device, so it does not alter your registry.
I do not have enough information on your current setup to know why you need a separate BC install for each project.
If your BC install can be on a single machine, you can use folders in the graphical interface to separate sessions for different projects.
If your projects are on different computers, you can setup a Shared Sessions.xml and access it from any machine on the network. This is under the Options dialog -> General section.
If your machines are not networked, you can use a portable USB device to carry your BC3 install and settings.
Update: talked with Craig. He brought up this is probably related to your earlier requests with versioning specific settings with specific projects. That makes sense. I was focused on the request to delete orphan wma and wav and missed the connection to your bigger picture item.
Last edited by Aaron; 08-Oct-2010, 04:01 PM.
Reason: Updated
I do not have enough information on your current setup to know why you need a separate BC install for each project.
I see no other way to store sessions as part of the project. Do you?
Originally posted by Aaron
If your BC install can be on a single machine, you can use folders in the graphical interface to separate sessions for different projects.
That's just presentation. It is no help at all to keeping a project self-contained e.g. archivable and restorable.
Originally posted by Aaron
If your projects are on different computers, you can setup a Shared Sessions.xml and access it from any machine on the network. This is under the Options dialog -> General section.
If your machines are not networked, you can use a portable USB device to carry your BC3 install and settings.
Thanks, but neither meets the requirement.
Originally posted by Aaron
Update: talked with Craig. He brought up this is probably related to your earlier requests with versioning specific settings with specific projects. That makes sense. I was focused on the request to delete orphan wma and wav and missed the connection to your bigger picture item.
It is not a question of versioning, but simply storing. If a project that invokes BC to perform something like deleting orphans as part of a build, this must remain intact as part of the project, and independent of the machine it is running on. I.e. not get lost or changed because the some BC setting is stored outside the project e.g. global for the user.
That is acheivable with the currrent BC when deleting orphans of the same type, but not when deleting e.g. .OBJ from .C or in this current case .WAV from .WMA. I consider the general limitation that causes this case to be lamentable. It makes much of the power of BC lost to serious automated usage.
Comment