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

AltKeyHandler Macro in OOo 2.0.0
Goto page 1, 2  Next
 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Writer
View previous topic :: View next topic  
Author Message
Momo
Newbie
Newbie


Joined: 22 Oct 2005
Posts: 3

PostPosted: Sat Oct 22, 2005 1:51 am    Post subject: AltKeyHandler Macro in OOo 2.0.0 Reply with quote

Hi,

I am a first time installer of OpenOffice. With version 2.0.0 coming out just recently I thought I'd give it a try. One thing that I am really missing in Writer is that I cannot asign paragraph styles to the ALT-key like in Word.

I read about a Macro by Iaanz called AltKeyHandler (http://homepages.paradise.net.nz/hillview/OOo/) that would offer that functionality.

My problem now is that I cannot get this script to work with OpenOffice.org 2.0.0. Could there be an incompatibility problem with v2 so that it can only be used with versions 1.x. Or did someone get it to work with the new OOo 2.0 and I'm just doing something wrong?
Perhaps I should also mention that I am using the German version of OOo - no idea if this makes any difference.

The error message I get when creating a new text document after having AltKeyHandler globally assigned to OOo-Documents says somethig like the following:
"A scripting framework error occured while executing the basic script. vnd.sun.star.script:AltKeyHandler..AltKeyHandler.SetupAltKeyHandler?language=Basic&location=document.
Message: BasicProviderImpl::getScript: no sript!"

I'd highly appreciate any help on this topic!

Thanks in advance
Momo
Back to top
View user's profile Send private message
Momo
Newbie
Newbie


Joined: 22 Oct 2005
Posts: 3

PostPosted: Sat Oct 22, 2005 3:26 am    Post subject: AltKeyHandler up and running with OOo 2.0.0 Reply with quote

Hi,

for those interested. The AltKeyHandler-Macro is working with OOo 2.0.0. It is great and will make my transition from MS Word to OOo a lot easier. Thanx for that wonderful script!

Momo
Back to top
View user's profile Send private message
Leguar
Newbie
Newbie


Joined: 28 Oct 2005
Posts: 2

PostPosted: Fri Oct 28, 2005 2:30 pm    Post subject: Reply with quote

Momo,
You seem to have solved your problem of "scripting framework error". I get the same message when I try to use launch two macros from a button on a toolbar:
- a macro downloaded also from Iannz OpenOffice.org page.
- a small macro that I have created to convert the tables to text.
I think that my problem comes from the fact that I did not install properly the macros, but I don't know how to do (I am also a newbie, trying to replace Office XP with OO).
Please, tell me how you solved your problem.
Thank you in advance.
.
Back to top
View user's profile Send private message
Momo
Newbie
Newbie


Joined: 22 Oct 2005
Posts: 3

PostPosted: Tue Nov 01, 2005 10:28 am    Post subject: Reply with quote

Hi Leguar,

have a look at Iaanz's homepage. He posted two installation instructions on how to install the AltKeyHandler macro under OOo 2.0. One is in German with screenshots, the other is in English.

Hope this will help you to solve your problem.

Momo
Back to top
View user's profile Send private message
Leguar
Newbie
Newbie


Joined: 28 Oct 2005
Posts: 2

PostPosted: Thu Nov 03, 2005 2:54 pm    Post subject: Reply with quote

Momo,
Thank you for your help.
Back to top
View user's profile Send private message
fserieys
Newbie
Newbie


Joined: 09 Nov 2005
Posts: 2

PostPosted: Wed Nov 09, 2005 3:12 am    Post subject: Reply with quote

Hello,

I got exactly the same probem as Momo and Leguar after creating a macro.
The error message appeared each time I opened a file and It was impossible to make it desappear even after I deleted the responsible macro .
So, I decided to completely uninstall OOo V2.0, to delete all the remaining files and to make a new installation. Stupefaction : the same error massage with reference to the name of the initial macro (deleted 3 days before) appears again when I open a OOo file
Has someboby an idea about how get rid of this hyperresistant error message ?

Francis
Thank you for your help
Back to top
View user's profile Send private message
Iannz
OOo Advocate
OOo Advocate


Joined: 14 Feb 2004
Posts: 494
Location: Christchurch, New Zealand

PostPosted: Thu Nov 10, 2005 6:05 pm    Post subject: Reply with quote

Hi Francis,

fserieys wrote:
I got exactly the same probem as Momo and Leguar after creating a macro.


Could you quote the extact error message and I may be able to help.
_________________
Cheers, Ian

http://wiki.services.openoffice.org/wiki/Extensions_development_basic a wiki about writing OpenOffice.org extensions.
Back to top
View user's profile Send private message
revnomad
OOo Advocate
OOo Advocate


Joined: 23 Feb 2003
Posts: 211
Location: NE Nebraska

PostPosted: Thu Nov 10, 2005 9:04 pm    Post subject: AltKeyHandler Reply with quote

I had almost forgotten about this gem. How do you get it to work in OO2? I've tried the instructions but nothing happens.
NTP
Back to top
View user's profile Send private message
Iannz
OOo Advocate
OOo Advocate


Joined: 14 Feb 2004
Posts: 494
Location: Christchurch, New Zealand

PostPosted: Thu Nov 10, 2005 11:56 pm    Post subject: Re: AltKeyHandler Reply with quote

revnomad wrote:
I had almost forgotten about this gem. How do you get it to work in OO2? I've tried the instructions but nothing happens.
NTP

If you have followed the instructions, then when a document is created or opened a Setup routine is run that inetercepts key presses. If the key press corresponds to a "known" sequence then the action is run. E.g. By default Alt+A should diplay the dialog for changing Alt+key shortcuts.
_________________
Cheers, Ian

http://wiki.services.openoffice.org/wiki/Extensions_development_basic a wiki about writing OpenOffice.org extensions.
Back to top
View user's profile Send private message
revnomad
OOo Advocate
OOo Advocate


Joined: 23 Feb 2003
Posts: 211
Location: NE Nebraska

PostPosted: Fri Nov 11, 2005 5:36 am    Post subject: behaving badly Reply with quote

Something is behaving badly Alt-A brings up the Table menu!?????? Rolling Eyes


When I have time I'm going to remove AltKeyHandler and start over with it.

NTP
Back to top
View user's profile Send private message
Bhikkhu Pesala
Super User
Super User


Joined: 23 Aug 2005
Posts: 2324
Location: Seven Kings, London, UK

PostPosted: Fri Nov 11, 2005 8:37 am    Post subject: Reply with quote

I finally got the AltKeyHandler working.

  • After installing macros, one needs to run the SetupAltKeyHandler macro.
  • Then one can press Alter A to assign different commands to shortcuts.
  • I assigned the HexUnicode macro to Alt X, so Alt X now brings up a dialog into which one enters the Hex code.
  • I also customized my menu to add a Macros menu to make it easier to work with the AltKey Macros.

_________________
Fonts * Opera * Oo Tips * FAQ * New Forum
Oo 2.3.1 * Win XP
Back to top
View user's profile Send private message Visit poster's website
karelc
General User
General User


Joined: 07 Jul 2006
Posts: 13
Location: Spain

PostPosted: Sat Jul 08, 2006 8:15 am    Post subject: Reply with quote

I'm having difficulty getting AltKeyHandler to work when I assign macros to it in OpenOffice v. 2.0 (Spanish version) running with Windows XP SP2.

AltKeyHandler works correctly when I assign text (for example, inserting my name, or an ellipsis sign). Or when I assign a command (e.g., DelToEndOfLine). Or when I assign a style command selected from the list of commands that appears in the dialogue box (for example, Encabezado 1, which is the Spanish for Header 1). But nothing happens when I press Alt key combinations which I've assigned to simple macros that I've recorded myself (e.g., changing the order of two letters in a word, or setting the background colour to yellow), or to macros which come with OpenOffice (e.g., Gimmicks.ReadDir).

Both types of macro (my recorded ones and the preinstalled ones) work correctly if I run them from the Tools menu (I assume that's what it's called in English), in Tools, Run Macro. And they also work if I assign them to Control key combinations, via Tools, Customize, Keyboard.

Curiously, AltKeyHandler doesn't show all the macros which I see when I enter the Tools menu and choose Run Macro. Macros which are present (i.e., they come pre-installed with OpenOffice) but don't show up include Hello World, Capitalise, Export, Highlight, Memory Usage and Schedule. Is there something hiding these macros from AltKeyHandler?

Of the functions that come built into AltKeyHandler, some respond to their pre-assigned Alt key combinations and some don't. The functions for indents, hanging indents and setting and finding a temporary bookmark respond to their Alt key combinations and work correctly for me. The functions for headings, subtitle, title and watermark don't respond to their pre-assigned Alt key combinations. But, as I indicated above, it seems that the commands will work if I reassign them by selecting the equivalent Spanish name in the list of Style commands.

That leaves me with the problem of still not being able to get my macros to run in response to Alt key combinations. I'd be grateful for any suggestions.
Back to top
View user's profile Send private message
Bhikkhu Pesala
Super User
Super User


Joined: 23 Aug 2005
Posts: 2324
Location: Seven Kings, London, UK

PostPosted: Sat Jul 08, 2006 10:12 am    Post subject: Reply with quote

If you haven't already done so, you ccould vote for this Issue to get it fixed.

You and many other users could spend a lot of time trying to get the Alt-key macros to work properly when it should really be a built-in function. Ian obviously spent a good deal of time writing the macros in the first place.

You could also try a third party macro recorder like Perfect Keyboard Pro which has the advantage of working across applications — not only in Open Office.

“Hello World” assigned to Alter 0 key.
“Hello World” assigned to Alter 0 key.
“Hello World” assigned to Alter 0 key.
_________________
Fonts * Opera * Oo Tips * FAQ * New Forum
Oo 2.3.1 * Win XP
Back to top
View user's profile Send private message Visit poster's website
Iannz
OOo Advocate
OOo Advocate


Joined: 14 Feb 2004
Posts: 494
Location: Christchurch, New Zealand

PostPosted: Sun Jul 09, 2006 2:39 pm    Post subject: Reply with quote

karelc wrote:
But nothing happens when I press Alt key combinations which I've assigned to simple macros that I've recorded myself (e.g., changing the order of two letters in a word, or setting the background colour to yellow), or to macros which come with OpenOffice (e.g., Gimmicks.ReadDir).


I may be wrong but are you actually assigning the macro and not just the library that the macro resides in. E.g. Gimmicks.ReadDir.Main

karelc wrote:
Curiously, AltKeyHandler doesn't show all the macros which I see when I enter the Tools menu and choose Run Macro. Macros which are present (i.e., they come pre-installed with OpenOffice) but don't show up include Hello World, Capitalise, Export, Highlight, Memory Usage and Schedule. Is there something hiding these macros from AltKeyHandler?


The macro was originally written for OOo1.1.x which didn't have support for scripts other than BASIC. The macros that don't show up in the list are those written in other scripts (Python,Bash etc). The reason for this is that the macro searches the text of the BASIC modules to find the names of the subroutines and functions.

karelc wrote:
Of the functions that come built into AltKeyHandler, some respond to their pre-assigned Alt key combinations and some don't. The functions for indents, hanging indents and setting and finding a temporary bookmark respond to their Alt key combinations and work correctly for me. The functions for headings, subtitle, title and watermark don't respond to their pre-assigned Alt key combinations. But, as I indicated above, it seems that the commands will work if I reassign them by selecting the equivalent Spanish name in the list of Style commands.


Being barely monolingual I have no experience with OOo in other languages. I was aware that there are differences between the internal names of styles and displayed names. For simplicity of coding and for users I decided to stick with the displayed names - unfortunately as you have discovered these are different for different languages.

karelc wrote:
That leaves me with the problem of still not being able to get my macros to run in response to Alt key combinations. I'd be grateful for any suggestions.

If your are assigning the library.module.macro and the macro you recorded or create works from the tools > macros > run then I am not sure what is going wrong for you.
_________________
Cheers, Ian

http://wiki.services.openoffice.org/wiki/Extensions_development_basic a wiki about writing OpenOffice.org extensions.
Back to top
View user's profile Send private message
hholler
Newbie
Newbie


Joined: 29 Aug 2006
Posts: 1

PostPosted: Tue Aug 29, 2006 4:03 am    Post subject: Problem with templates Reply with quote

Hi all,

I got the macro to work with the explanations on Ian's website (http://homepages.paradise.net.nz/hillview/OOo/). I also got them to start everytime I create a new document or open an existing one.

Except when I'm using templates. I have created my own templates with special formatting for documents I write regularly (memos), so they have a standard header with typical information. But other than with an empty new document, when trying to create a document from one of the templates, I always get the error message

com.sun.star.uno.RuntimeExceptionScriptProtocolHandler::createScriptProvider(),

The macro does not work within these documents and will not even run if I call it from the menu by hand (the error message here is: com.sun.star.uno.RuntimeException). These error messages leave me in the dark about what to change in my setup. Does anyone have an idea?

It would be really helpfull if the macro ran in template created docs as well and not just in plain simple empty ones.

Thanks for your efforts.

cheers, Helge
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Writer All times are GMT - 8 Hours
Goto page 1, 2  Next
Page 1 of 2

 
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