Page 1 of 1

Assigning shortcut keys and deleting macros

Posted: Sun Oct 02, 2011 12:18 am
by garrymo
:( I spent some time assigning shortcut keys to various special characters such as the spanish accented vowels but found that once created, the shortcut key always defaults to the font used when the macro was recorded. Meaning if " á " was recorded in arial, whenever I'm writing in Times New Roman and need that symbol, the shortcut key will retrieve it only in arial. However, the shortcuts only worked for about a week and now when used they open a page called "My macros and dialogs.standard" with an error warning/notification: "BASIC syntax error.Symbol expected" which requires three clicks to close.

How do I assign permanent shortcut keys that work in all texts?
How do I remove the macros that are persisting in my: customize: keyboard: functions: macros category box even after deleting them several times from the shortcut list?

Re: assigning shortcut keys and deleting macros

Posted: Sun Oct 02, 2011 11:15 am
by floris v
Binding accented letters to macros with keyboard shortcuts is rather expensive in keyboard shortcuts. It's better to use a program like allchars or an extension. You can even use the United States (international) keyboard (in Windows), but that will make typing quotation marks followed by characters that may combine into accented letters (all vowels, y and c) more troublesome.

Re: assigning shortcut keys and deleting macros

Posted: Sun Oct 02, 2011 2:01 pm
by franx
garrymo wrote::( I spent some time assigning shortcut keys to various special characters such as the spanish accented vowels but found that once created, the shortcut key always defaults to the font used when the macro was recorded. Meaning if " á " was recorded in arial, whenever I'm writing in Times New Roman and need that symbol, the shortcut key will retrieve it only in arial. [...]
How to modify a recorded macro á, ñ, etc. (should work fine with all fonts)
[LibreOffice 3.4.3]:

Go to menu
Tools > Macros > Organize Macros > LibreOffice Basic > My Macros > Standard > Module1
Select the relevant macro (e.g.: 'insert_ar' = á) > Edit

The recorded macro 'insert_ar'

Code: Select all

sub insert_ar
rem ----------------------------------------------------------------------
rem define variables
dim document   as object
dim dispatcher as object
rem ----------------------------------------------------------------------
rem get access to the document
document   = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")

rem ----------------------------------------------------------------------
dim args1(1) as new com.sun.star.beans.PropertyValue
args1(0).Name = "Symbols"
args1(0).Value = "á"
args1(1).Name = "FontName"
args1(1).Value = "Liberation Sans"

dispatcher.executeDispatch(document, ".uno:InsertSymbol", "", 0, args1())

end sub
Remove the following lines, and save the file...

Code: Select all

args1(1).Name = "FontName"
args1(1).Value = "Liberation Sans"
The modified macro 'insert_ar'[/b]

Code: Select all

sub insert_ar
rem ----------------------------------------------------------------------
rem define variables
dim document   as object
dim dispatcher as object
rem ----------------------------------------------------------------------
rem get access to the document
document   = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")

rem ----------------------------------------------------------------------
dim args1(1) as new com.sun.star.beans.PropertyValue
args1(0).Name = "Symbols"
args1(0).Value = "á"

dispatcher.executeDispatch(document, ".uno:InsertSymbol", "", 0, args1())

end sub
Test
test_á_fonts.png
test_á_fonts.png (9.2 KiB) Viewed 7290 times
BTW: In real life I prefer the extension → Compose Special Characters
;)

Re: Assigning shortcut keys and deleting macros

Posted: Mon Oct 03, 2011 12:29 am
by garrymo
I downloaded and installed the extension, restarted, but nothing shows in my Insert menu.
I checked in "downloads" where it informed me that the extension is installed. What's the next step to get it into "Insert", please?

I sent an email to: "support@productivityapps.com" for assistance but it came back as undeliverable.

Re: Assigning shortcut keys and deleting macros

Posted: Mon Oct 03, 2011 2:39 am
by garrymo
update:
on checking into my downloads file I find that upon installing, LibreOffice over-rode O O and the extension is there, in L O. How can I get the download to install into O O and prevent L O from grabbing it?

Re: Assigning shortcut keys and deleting macros

Posted: Mon Oct 03, 2011 2:40 am
by garrymo
update: :?:
on checking into my downloads file I find that upon installing, LibreOffice over-rode O O and the extension is there, in L O. How can I get the download to install into O O and prevent L O from grabbing it?

Re: Assigning shortcut keys and deleting macros

Posted: Mon Oct 03, 2011 8:37 am
by floris v
Open OOo, open the extensions manager, select the extension and install.
Note that in the OOo/LO etc series the last installed program will override all file bindings, including to opening odt, ods etc..

Re: Assigning shortcut keys and deleting macros

Posted: Tue Oct 04, 2011 2:29 am
by garrymo
Well, for a few moments that worked. I was happy but NOW, in the insert menu the extension notation has disappeared.
At TOOLS; EXTENSION MANAGER; it shows the extension as being there and I've reinstalled it, disabled it and then enabled it again, but NOTHING in the INSERT menu. . .

Also,theres another OO forum site. It's not this one. At the same time I lost the extension, I also lost the listing for this forum in my "favorites"menu. Searching on Yahoo for a link gives: www.oooforum.org
and brings up a site that says it's OO forums but is not THIS site. What's happening?