Failing which, how else can I export an HTML file to the root foolder of a library, referencing tracks within in a way that survives library relocation? Thanks.
Update the base reference when moving to another root.
Not an option sadly, because it may not be me doing the moving. In the most geenral case, the library may be on a removable drive and hence get a different drive letter each time.
Remove the base reference and let the href anchor completely relative.
It for that that I asked the original question. If you can show me how to do that in Mp3tag script, I would be grateful.
The file "index.htm" and the folderpath beginning at folder "album" share the same root, it is their home folder "Music".
It is obvious that all files in the folderpath down under "album" are located relative to the "index.htm" which can be referenced from within the "index.htm" by a relative filepath e. g. ".\album..."
This is a relative path starting from the current location of the "index.htm".
In case you move the foldertree to another place you have to move "index.htm" accordingly.
It is obvious that all files in the folderpath down under "album" are located relative
to the "index.htm" which can be referenced from within the "index.htm" by a
relative filepath e. g. ".\album..."
This is a relative path starting from the current location of the "index.htm".
Agreed, and I am indeed able to code a script for that specific example, but it would fail for others e.g.
This is the same case as before. Common root folder is "C:".
From the same point of view you can access the file by relative reference ".\Music\album\disc\track.WMA"
Relative means that there is a relation between the two items.
In this case the relative path starting from the location where the file "index.htm" resides to the target file "track.WMA" is:
"......\Music\album\disc\track.WMA"
It has somewhat to do with the behaviour of apes in a djungle tree:
up, up, up, jump over to the other branch, down, down, catch the banana.
The html "control" file and all other involved "connected" files are united by a fix binding relation, which is not to be allowed to be broken up in order to work correctly, even after moving or mapping the file/folder structure to another root folder or drive.
When you code your export script you know this relation.
You always create a report of a known file/folder structure.
Your report file may be created somewhere else, but you know where it is, and therefore the relation is known while design time.
You can reach each file in your music base structure by using the fitting relative path to this file.
chrisjj, we are discussing a basic file system navigation method.
I don't believe that you know nothing of it.
I have a feeling of a great misunderstanding.
Similar but not the same. There is a different relative relation between index and track files.
Relative means that there is a relation between the two items.
In this case the relative path starting from the location where the file
"index.htm" resides to the target file "track.WMA" is:
"......\Music\album\disc\track.WMA"
Agreed, and because the relation is different, the script solution that ahrd-codes the relation for the first example would not work on this example.
The html "control" file and all other involved "connected" files are united by a fix
binding relation, which is not to be allowed to be broken up in order to work correctly,
even after moving or mapping the file/folder structure to another root folder or drive.
Agreed.
When you code your export script you know this relation.
Not agreed! The two examples have different relations and hence no script of the type that you suggested, ahrdcoding a relation using %_folder% etc. will work for both.
Your report file may be created somewhere else, but you
know where it is, and therefore the relation is known while design time.
Unfortunately the report file location is not known at scrip design time. It is known only at script execution time - the user sets the report file location by entering iot in "Export file name" (actually Export file path), just before execution.
A script could probably meet the requirement if the script language had placeholders to access the Export file name.
chrisjj, we are discussing a basic file system navigation method.
I don't believe that you know nothing of it.
I believe you are right!
I have a feeling of a great misunderstanding.
I hope my points above in this message has resolved the misunderstanding.
From the viewpoint of the index file I would say no.
Maybe ..., but I never have driven me into such indifferent situation, maybe by incorporated programming style I always try to find a common anchor point.
Oh yes, you are right! Using the dialog edit field a Mp3tag user can only define a different output location for the new report file. To use a different music database folder as a new starting location the internal code has to be updated.
To handle such a situation in a good manner we need a scriptable Open/SaveAs user dialog module.
Erroneous mistake by me, because the "starting location" or "starting folder" simply does not exist because the base of an export routine is always the currently selected tracklist. The input list is a collection of tracks which can be located elsewhere on the local or net drives.
Even better ... %_export_path%
... that means all path components (drive, folderpath, filename, extension) of the current export file.
... maybe splitted into its subcomponents too ... %_export_folderpath% %_export_filename_ext%
Those placeholder should carry a value in both cases (for user defined filename and hard coded filename).
solves my requirement at least when the output file is in a parent folder of all track files. EDIT ... and also in all teste other cases that can be relativised e.g. ..\