Posted: Sat Nov 26, 2005 2:52 am Post subject: Automatic text hiding?
When drafting documents, I routinely add comments to myself in [brackets]. Usually all sorts of grammar and word choice questions that I intend to come back to later with "fresh eyes". However, I often run into the problem of wanting to export or print out a draft for consumption by others. Hitherto, I've been stuck going back and manually selecting and deleting all of the [bracketed bits].
Tonight as this occurred again, I waded through the help for a better solution. I found the section on hidden text, but from what I understood of the instructions, there's not a very easy way to create these special fields. Inserting custom fields and setting variables on them is a lot more work than just typing []s.
Is there any way to automatically hide/not print text that matches a regexp, perhaps? Or another way to do what I'm trying to do? I can't be the only one annotating his documents, can I? (Speaking of annotations, a quicker method of highlighting/un-highlighting would be grand, too).
Sincere advance thanks for any info,
Jeremy M. Dolan
Joined: May 25, 2003 Posts: 4752 Location: Santa Barbara, CA
Posted: Sat Nov 26, 2005 8:28 am Post subject:
This is something that I've not tried to do myself in OOo, but if you can find a way to do it on other platforms than the same should apply to Neo. One idea might be to try and use the change tracking and then hide/show changes, but that isn't exactly what you're looking for. I'd give the following OOo community a try in the Writer forums:
You can use the menu option Insert->Note... to put a note anywhere in the text which will be non-printing unless you specify otherwise. It will appear as a little yellow box, and double-clicking on the box pops up the dialogue box with the note/author/date in it, which you can then edit and datestamp.
Then you can use Tools->Configure to assign this to e.g. F8 so it's a one-key action to add a new note.
I realise this isn't as immediate as being able to read your notes as you look down the page, but it is easy to see where they are, and quick to access them (and a lot less fiddly than the 'hidden text' palaver, which I still can't get to work...).
I've never used that feature except in verifying a nasty (OOo) bug in it (it can hang if the note is too long--several pages worth--IIRC), but at least in some cases the note text appears if you hover over the note marker....
Smokey _________________ "[...] whether the duck drinks hot chocolate or coffee is irrelevant." -- ovvldc and sardisson in the NeoWiki
Joined: May 25, 2003 Posts: 4752 Location: Santa Barbara, CA
Posted: Sun Nov 27, 2005 9:02 am Post subject:
I've not had a problem with the tooltips appearing with the note text (let the mouse hover over the small yellow square).
Yet another option would be to create a new style, such as "comment". If you then set all of that commentary to that style, you can search and delete the text based on that style. This use of styles is something that's really good in OOo but rather clunky in Word. Unfortunately, the autoformatting rules for **/__ autoformatting characters aren't extensible, so you'd need to use another way to set the style.
I break my head on this problem, and I build a simple solution: keep using the [ and ] to write comments.
when you have to print save your document and start this macro:
***
sub seekanddestroy2
cursore=thiscomponent.text.createtextcursor()
cursore.gotostart(false)
finquando=thiscomponent.text.createEnumeration()
lettera$="a"
while lettera$<>""
cursore.goright(1,true)
rem cosa=thiscomponent.getcurrentselection().getbyindex(0)
lettera$ = cursore.getstring()
if lettera$="[" then
do until lettera$="]"
cursore.setstring("")
cursore.goright(0,false)
cursore.goright(1,true)
lettera$ = cursore.getstring()
loop
cursore.setstring("")
end if
cursore.goright(0,false)
wend
end sub
***
when the macro ends, print your document.
after, if you want to keep the comments close the document without save the file.
it is slow, but you can get a coffee while you are waiting.
I break my head on this problem, and I build a simple solution: keep using the [ and ] to write comments.
when you have to print save your document and start this macro:
Wow, an automatic de-bracketer. That is an innovation. We should send this to the climate conference in Montreal..
(My apologies for an unintelligible joke if you haven't been to international diplomatic meetings. The modus operandi there is to put anything that hasn't been agreed on between brackets.
Then these are discussed, replaced discussed again, postponed until the next meeting, an ad-hoc group formed to provide further input, then discussed some more, revised again, then hammered out in a back-room deal and presented to the main conference. Then a final text is agreed on and half of the countries refuse to implement it....) _________________ "What do you think of Western Civilization?"
"I think it would be a good idea!"
- Mohandas Karamchand Gandhi
next time I'll go in montreal I'll sell this macro.
btw thanks to matteo cavalleri, I think this macro is cleaner and a lot faster
sub seekanddestroy4
dim seek
seek = thiscomponent.createReplaceDescriptor()
seek.SearchString = "\[[^\[\]]+\]"
seek.ReplaceString = ""
seek.SearchRegularExpression=True
thiscomponent.ReplaceAll(seek)
end sub
next time I'll go in montreal I'll sell this macro.
Nice! Actually, I put it at the Wiki, so remove it there if you intend to milk it for all of the euros you can get.. _________________ "What do you think of Western Civilization?"
"I think it would be a good idea!"
- Mohandas Karamchand Gandhi
next time I'll go in montreal I'll sell this macro.
Nice! Actually, I put it at the Wiki, so remove it there if you intend to milk it for all of the euros you can get..
Oscar and I are on disturbingly similar wavelengths I was just thinking we should have a page of "Useful Macros" or something on the wiki, to collect fabrizio's and the others mentioned here (e.g., Ianz's Find and Replace, which is already linked from the "Find and Replace tips" page, so not such a great example...).
Smokey _________________ "[...] whether the duck drinks hot chocolate or coffee is irrelevant." -- ovvldc and sardisson in the NeoWiki
Oscar and I are on disturbingly similar wavelengths
If I ever get back to DC, we're going out for some drinks .
As usual, feel free to edit at http://neowiki.sixthcrusade.com/index.php/Removing_marked_text, available from the hints&tips section. _________________ "What do you think of Western Civilization?"
"I think it would be a good idea!"
- Mohandas Karamchand Gandhi
oh well, I WROTE THE MACRO I WANT THE BEER!
matteo cavalleri only wrote the '+' inside my wrong code!!
when you'll come to italy I'll be happy to drink the beer.
btw, this is the macro working I'm doing in freetime, a editor for a 'idra' language to do interactive fiction (my first dialog!)
oh well, I WROTE THE MACRO I WANT THE BEER!
matteo cavalleri only wrote the '+' inside my wrong code!!
when you'll come to italy I'll be happy to drink the beer.
It wasn't clear to me, either, that you wrote the second one, too. It is a wiki, though, so you could edit and fix the attribution yourself (but I've fixed it now )
Smokey _________________ "[...] whether the duck drinks hot chocolate or coffee is irrelevant." -- ovvldc and sardisson in the NeoWiki
Posted: Tue Jan 17, 2006 6:50 pm Post subject: Thanks!
A bit late, but I just wanted to thank Fabrizio for the macro. I haven't had occasion to test it out just yet, as I had already finished my term paper last semester, but I expect to be in great need of it in about a month (mid-terms). Now I just need to figure out how to install and/or run an OpenOffice macro, but I think I can handle that one on my own.
Thanks again! I can hardly wait to write my next paper now!
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum