Page 1 of 1

[Solved] Label Format Save location

Posted: Sat Jan 05, 2019 3:12 am
by stanheer
Before I understood anything, I created a new Label Format for an Avery label 5689, which is not in the Avery list. I saved as Brand "Avery 5689", Type "User". Now that I understand the organization structure a little better, I would like to change this to Brand "User", Type "Avery 5689", or add it to the Avery list. How/can I do this? I do not see an option to delete a Label Format. Where are these templates(?) stored? They do not appear in the Options/Paths/Templates list. Are they actually templates (.ott)? I know I could just save a new one with the right names, but I would rather do it right. Plus, my curiosity has been piqued. Thanks.

Re: Label Format Save location

Posted: Sat Jan 05, 2019 2:22 pm
by John_Ha
I think it is somewhere in the User Profile.

About the only thing you can do is reset the profile - see Resetting the user profile which gets rid of it. Keep on checking as you copy back the old profile until it reappears - it's in the last thing copied back.

Let us know if you find it.

Re: Label Format Save location

Posted: Wed Aug 03, 2022 1:20 pm
by miasma.gajs
I would like to uninterr this thread in case there is any further knowledge of how to manage label templates (formats). I have created a number of test label templates and want to delete or just re-name them - any help please?

Resetting the profile is last resort as I assume it will delete a bunch of stuff I want to keep, including successful customised label templates.

Re: Label Format Save location

Posted: Thu Apr 20, 2023 9:13 pm
by MrProgrammer
stanheer wrote: Sat Jan 05, 2019 3:12 am Plus, my curiosity has been piqued.
Thank you for the interesting question.

stanheer wrote: Sat Jan 05, 2019 3:12 am [The label templates that I created] do not appear in the Options/Paths/Templates list. Are they actually templates (.ott)?
No, they are not stored as Writer templates (file extension OTT).

miasma.gajs wrote: Wed Aug 03, 2022 1:20 pm I have created a number of test label templates and want to delete or just re-name them - any help please?
User-defined label templates are stored as settings in registrymodifications.xcu in the user profile. This large file (mine is about a megabyte) contains thousands of OpenOffice settings. I do not know of any supported OpenOffice procedure to remove the label template settings except a profile reset. The user profile is the folder ending in /user/ that is shown in option OpenOffice → Paths. Options are set with OpenOffice → Preferences on a Mac, Tools → Options on other platforms.
202304202103.gif
202304202103.gif (65.62 KiB) Viewed 2962 times

After terminating OpenOffice I was successful removing only my user-defined labels from registrymodifications.xcu using UNIX tools on my system. Disclaimer: This procedure has had minimal testing. It looks simple, but I spent many hours researching how to accomplish this. Be sure to observe the distinction between - and ~ in the sed command.

cd "location-of-user-profile"                                        # From above, blue box
xcu=registrymodifications.xcu; old=registrymodifications.old         # Set file name variables
key="//item[@*[1]='/org.openoffice.Office.Labels/Manufacturer']"     # Key of item for user-defined labels
cp $xcu $old                                                         # Create backup of registrymodifications.xcu
sed "s~$(xmllint --xpath $key $old)~~" $old >$xcu                    # Remove item from registrymodifications.xcu

If you want to retain some of your user-defined label templates you would need to run the xmllint command, examine the output, edit it to remove the items you want to retain, and then pass that string of data to sed for deletion. Unless you are experienced with UNIX tools and with XML this will not be easy. But you can use File → New → Labels, note the attributes of the label templates you want to keep, delete all of them, and then re-define the ones you wanted to keep.