[Solved] Label Format Save location

Using them, Making them, Finding them
Locked
stanheer
Posts: 4
Joined: Sat Dec 19, 2015 12:52 am

[Solved] Label Format Save location

Post 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.
Last edited by MrProgrammer on Mon May 01, 2023 1:44 am, edited 1 time in total.
Reason: Tagged ✓ [Solved], location is registrymodifications.xcu -- MrProgrammer, forum moderator
Open Office 4.1.2 on Windows 7
John_Ha
Volunteer
Posts: 9583
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: Label Format Save location

Post 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.
LO 6.4.4.2, Windows 10 Home 64 bit

See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.

Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
miasma.gajs
Posts: 28
Joined: Thu Sep 18, 2014 1:18 pm

Re: Label Format Save location

Post 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.
Apache OpenOffice 4.1.13
MS Windows 7 Pro x64 SP1
User avatar
MrProgrammer
Moderator
Posts: 4894
Joined: Fri Jun 04, 2010 7:57 pm
Location: Wisconsin, USA

Re: Label Format Save location

Post 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 2716 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.
Mr. Programmer
AOO 4.1.7 Build 9800, MacOS 13.6.3, iMac Intel.   The locale for any menus or Calc formulas in my posts is English (USA).
Locked