OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

Can anyone change a macro into an add-on?

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API
View previous topic :: View next topic  
Author Message
fortydeuce
General User
General User


Joined: 10 Dec 2006
Posts: 6

PostPosted: Sun Dec 10, 2006 1:42 pm    Post subject: Can anyone change a macro into an add-on? Reply with quote

I found this macro for Python:

http://yawar.blogspot.com/2006/05/live-word-count-script-for.html

... but cannot for the life of me get it to change into a macro. So I'm wondering if there's anyone out there that knows scripting well enough and thinks it would be quick enough to turn this into a proper add-on. I know no scripting languages whatsoever, have spent the past two hours trying (and failing!) to get it to take. All I want is a live word count! Thanks in advance.

Alternately, if anyone knows any OTHER live word counts (esp. one that automatically updates in the status bar) for openoffice, that would be just as good. Thanks again.
Back to top
View user's profile Send private message
Villeroy
Super User
Super User


Joined: 04 Oct 2004
Posts: 10106
Location: Germany

PostPosted: Sun Dec 10, 2006 3:03 pm    Post subject: Reply with quote

Save the code in a plain text file in your userdirectory:
In Linux it is ~/.openoffice.org2/user/Script/python/wordcount.py
Directory python is not there by default, so add it. The .py suffix is important.
Then browse Tools>options>macros>My Macros
There should be "wordcount" as a library with "wordCount" as callable routine. Call it. If it works, you may want to assign a shortcut, menu-entry or button.
For more stuff like that search this forum and the code snippets for word count using the "Search" link above.
_________________
Rest in peace, oooforum.org
Get help on https://forum.openoffice.org
Back to top
View user's profile Send private message
fortydeuce
General User
General User


Joined: 10 Dec 2006
Posts: 6

PostPosted: Sun Dec 10, 2006 4:11 pm    Post subject: Reply with quote

What you describe is exactly what I've done (in windows, putting it under c:/documents and settings/<user>/application data/openofficeorg.2/user/scripts/python after saving it in notepad as wordcount.py.)

When I go into tools>options>macros>My Macros, I receive the library, but no callable routine.

I am running Windows XP Pro and OOo 2.04 - just checked today for updates before trying to install this, and I'm up to date.

ETA: I'm browsing into a different menu: tools>macros. tools>options has no macros sublibrary/tab/index/whatever.
Back to top
View user's profile Send private message
B Marcelly
Super User
Super User


Joined: 12 May 2004
Posts: 1453
Location: France

PostPosted: Mon Dec 11, 2006 4:02 am    Post subject: Reply with quote

fortydeuce wrote:
What you describe is exactly what I've done (in windows, putting it under c:/documents and settings/<user>/application data/openofficeorg.2/user/scripts/python after saving it in notepad as wordcount.py.)

Python scripts in OpenOffice.org must have Unix-style line ends. Use an editor which can create such text files.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group