Home Page list
TreeShare - Rename Cryptic Filenames for Citation Media #TreeShare #media #citations #batch
TreeShare downloads Ancestry media for citations with cryptic file names that mean nothing to humans. This set of scripts and batch or command-line operations prepends to the media filenames the name of one of the persons to whom the citation applies, their BirthYear-DeathYear and the name of the source cited, separated from the cryptic name by the @ symbol. Such information in the file names can help the user organise the downloaded media into folders by surname or even more finely divided. Renaming the files has no apparent effect on TreeShare operations.
A variant of the script could change the order in the new name to be source name first, which would aid in finding and reorganising by source, rather than by person.
Here is a screenshot showing results from a temporary table created by the second script which lists the Ancestry name (OldName) with its new, informative name.
Here is a screenshot of a Media Gallery after the files have been renamed.
Note that the source was cited to four facts or events about the person. and could be cited for multiple facts for multiple people, as, for example, a Census source and image could be tagged to Birth and Residence facts for all family members. However, there is only one image file for that source so the procedure takes the person and event last cited for use in the file name.
As always, use these tools at your own risk. I cannot predict all possible consequences. I saw no adverse effect in my one test case.
READ the comments at the beginning of each script and the instructions at the end, which will also be displayed on completion of the script execution. DO NOT CLOSE THE DATABASE IN THE SQLITE MANAGER UNTIL YOU NO LONGER WISH TO UNDO.
This script can do no harm. It is a variation of RM7_5-WaymarksViews.sql to revise the format and content of some of the Waymarks to suit this application. It generates a set of temporary SQLite Views with which one can inspect the contents of a table and from the Waymark info, navigate within RootsMagic to see where a record is used. For this application, it also generates a temporary table zMediaCitationTags needed for the following script.
Changes the media links so they will appear broken in the Media Gallery until you successfully rename the files with the batch commands it generates.
Changes the media links back and generates batch commands for changing the media file names back to their Ancestry original.
- A new filename might exceed the limit supported by the file system. Didn't happen in my test case and would require very long Ancestry file name, source name, person name (couple events would be worst case).
- There is a character in one of the names that is invalid for a file name. Didn't happen.
- Some RootsMagic operations may be locked out by having the database open in the SQLite manager and some may lock out the SQLite manager. Avoid doing a backup or using the RM Database Tools while in session on the SQLite manager. I've not had a problem while in TreeShare or main views and Edit Person. I'd be wary about going into FamilySearch Central and perhaps having WebHints on.