Search found 44 matches
- Sat Feb 12, 2022 7:08 am
- Forum: Macros and UNO API
- Topic: .uno:SpellOnline and .uno:SpellCheckerChanged
- Replies: 2
- Views: 2013
Re: SpellOnline
In older version, e.g. LO 6.1.5.2, it is on/off. I don't know why anyone would change it to toggle, which, as you correctly say, makes a function useless to macros. In my own programming (in any language/framework) I have a universal rule that functions may toggle something but also must accept an o...
- Sat May 08, 2021 8:09 pm
- Forum: Macros and UNO API
- Topic: Accessing GlobalScope.BasicLibraries Crash Report
- Replies: 6
- Views: 5366
Re: Accessing GlobalScope.BasicLibraries Crash Report
I have found the root of this problem. The method to find the problem may be the most useful information here. Following Villeroy's suggestion, I started a fresh user profile and the problem was gone, as were all of my customizations but not my libraries. By testing a mix of the fresh and old files ...
- Thu May 06, 2021 6:37 pm
- Forum: Macros and UNO API
- Topic: Accessing GlobalScope.BasicLibraries Crash Report
- Replies: 6
- Views: 5366
Re: Accessing GlobalScope.BasicLibraries Crash Report
Thank you Villeroy but I don't see a user.backup file (or directory) under ~/.config/libreoffice/4/user in my Linux system or under C:\Users\me\AppData\Roaming\LibreOffice\4\user in the W10 system. In both systems there is a directory called backup but it is empty.
- Thu May 06, 2021 6:28 pm
- Forum: Macros and UNO API
- Topic: Accessing GlobalScope.BasicLibraries Crash Report
- Replies: 6
- Views: 5366
Re: Accessing GlobalScope.BasicLibraries Crash Report
Thank you Bidouille for your response. To share my work with a wide range of users without forcing them to stay in lockstep I update only when I encounter a serious problem that requires updating. I don't think this is one of those because the problem doesn't occur in the older (albeit Linux rather ...
- Wed May 05, 2021 10:29 pm
- Forum: Macros and UNO API
- Topic: Accessing GlobalScope.BasicLibraries Crash Report
- Replies: 6
- Views: 5366
Accessing GlobalScope.BasicLibraries Crash Report
With LO 6.1.5.2 in W10, macros experience no immediate problem when accessing GlobalScope.BasicLibraries. Properties are correct and methods work without incident. However, when LO closes, it reports "crash" and on reopening does crash recovery. This only happens when GlobalScope.BasicLibr...
- Sat Jan 16, 2021 8:28 pm
- Forum: Macros and UNO API
- Topic: [Solved] Read keyboard state in a macro
- Replies: 2
- Views: 1847
Re: Read keyboard state in a macro
I haven't found an answer to the question as I stated it but I have found a simple answer to my specific problem. I only wanted to know the mod keys (Shift, Ctrl, Alt) at the time of a mouse button click. I knew that this information was available in a keypress event but didn't realize that it is al...
- Sat Jan 16, 2021 7:26 pm
- Forum: Macros and UNO API
- Topic: Indirect macro invocation with object argument
- Replies: 4
- Views: 5475
Re: Indirect macro invocation with object argument
Thank you Zizi64 for your quick reply. Unfortunately, my situation is more complex than that. Indeed, my "on document open" macro does call several others, as you suggest, but they are all known at compile time and can be invoked directly. If the macro is not known until run time it must b...
- Sat Jan 16, 2021 7:38 am
- Forum: Macros and UNO API
- Topic: Indirect macro invocation with object argument
- Replies: 4
- Views: 5475
Indirect macro invocation with object argument
I have registered a function to be invoked whenever any document is opened. Since only one macro can be assigned to this event, I want my function to play nicely by invoking macros specified by a user-defined list of similar functions in other libraries. Obviously, these functions cannot be embedded...
- Sun Jan 10, 2021 7:47 am
- Forum: Macros and UNO API
- Topic: [Solved] Read keyboard state in a macro
- Replies: 2
- Views: 1847
[Solved] Read keyboard state in a macro
Does OO/LO or UNO provide a function to enable a macro to determine the keyboard state, specifically of Shift, Ctrl, and Alt? I realize that I can register a keyboard listener but that is very expensive for an occasional event triggered by something else.
- Tue Dec 01, 2020 9:33 pm
- Forum: Macros and UNO API
- Topic: [Solved] Cursor Paragraph in AOO-Basic
- Replies: 10
- Views: 2569
Re: Cursor Paragraph in OO-Basic
JeJe, I have discovered why your suggestion has not been working for me. p=tc.createenumeration.nextelement does get the paragraph but its elements are enumerable only if the paragraph is selected. The OO code also works in LO but I think that vc.TextParagraph is a bit faster. function getEnumerable...
- Mon Nov 30, 2020 6:04 am
- Forum: Macros and UNO API
- Topic: [Solved] Cursor Paragraph in AOO-Basic
- Replies: 10
- Views: 2569
Re: Cursor Paragraph in OO-Basic
JeJe, thanks for you quick reply. I previously tested by modifying my rather complex macro. I tested your new suggestion with a dedicated macro on W10 with LO 6.1.5.2, W7 with OO 4.1.8, and Ubuntu-Mate 18.04 with LO 6.0.7.3. In all cases I got the same thing. The paragraph iterator (en.hasmoreelemen...
- Sun Nov 29, 2020 8:49 pm
- Forum: Macros and UNO API
- Topic: [Solved] Cursor Paragraph in AOO-Basic
- Replies: 10
- Views: 2569
Re: Cursor Paragraph in OO-Basic
JeJe, thank you for that suggestion. It would seem to be the solution in some cases but it is not working in the context of my program. My macro wants to find any bookmark or hyperlink coincident with the view cursor. It iterates over (elements of) the paragraph that contains the cursor and compares...
- Sat Nov 28, 2020 6:23 am
- Forum: Macros and UNO API
- Topic: [Solved] Cursor Paragraph in AOO-Basic
- Replies: 10
- Views: 2569
[Solved] Cursor Paragraph in AOO-Basic
I have created a Basic library under Libre that I'm trying to make available to users of Open. My code uses the TextParagraph property of view cursors, which doesn't exist in OO. OO-Basic text cursors also do not include this property and neither view cursors nor text cursors provides a method to ge...
- Sat Jul 18, 2020 5:51 pm
- Forum: Install, Setup and Troubleshooting
- Topic: Custom toolbar item with name and keyboard shortcut
- Replies: 2
- Views: 1674
Re: Custom toolbar item with name and keyboard shortcut
In any case, Lupp, thank you for the signature suggestion. I really wanted to change that but didn't know how.
- Sat Jul 18, 2020 4:48 am
- Forum: Install, Setup and Troubleshooting
- Topic: Custom toolbar item with name and keyboard shortcut
- Replies: 2
- Views: 1674
Custom toolbar item with name and keyboard shortcut
Using Tools > Customize > Toolbars, I have created a new toolbar and associated my macros with its items. Some of the macros are also associated with keyboard shortcuts. For these, the toolbar hover-tooltip shows only the shortcut. For the ones without corresponding shortcuts, the tooltip shows the ...
- Wed Jul 01, 2020 11:28 pm
- Forum: Macros and UNO API
- Topic: Get IDE line number
- Replies: 16
- Views: 5099
Re: Get IDE line number
That is an excellent answer JeJe. Those references not only justify using the number but also provide an ongoing means to track changes. The OO page also explains that constants are used instead of enums because that allows creating new cardinals, a strong hint that existing ordinals will not change...
- Wed Jul 01, 2020 12:23 am
- Forum: Macros and UNO API
- Topic: Get IDE line number
- Replies: 16
- Views: 5099
Re: Get IDE line number
Thank you so much for that JeJe. It works. I would like your opinion on one implementation issue. I am leery of using magic numbers but testing for 57 is certainly cheaper than testing supportsService. Do you think that the number is likely to be as stable as the text format (no need to ask it to be...
- Tue Jun 30, 2020 4:55 pm
- Forum: Macros and UNO API
- Topic: Get IDE line number
- Replies: 16
- Views: 5099
Re: Get IDE line number
JeJe-- your suggestion to get the line number from the status bar is great in concept but I have not been able to find the status bar recursing the AccessibleContext tree with root StarDesktop.CurrentComponent.CurrentController.Frame.ComponentWindow. I examined each object's Text and AccessibleConte...
- Thu Jun 18, 2020 1:08 am
- Forum: Macros and UNO API
- Topic: Get IDE line number
- Replies: 16
- Views: 5099
Re: Get IDE line number
Thank you Je Je for that very helpful suggestion. Building on that, I am able to get the text of the line containing the caret, which will be a big help beyond my immediate problem. The referenced example uses magic numbers for child indices and one of them fails in my system because the parent has ...
- Tue Jun 16, 2020 10:18 pm
- Forum: Macros and UNO API
- Topic: Get IDE line number
- Replies: 16
- Views: 5099
Re: Get IDE line number
Je Je, thank you for your quick reply. The only accessible context I've been able to find is StarDesktop.CurrentComponent.CurrentController.Frame.getContainerWindow().AccessibleContext This doesn't seem to have any cursor position information. It has Location and LocationOnScreen properties but thes...
- Tue Jun 16, 2020 7:15 pm
- Forum: Macros and UNO API
- Topic: Get IDE line number
- Replies: 16
- Views: 5099
Get IDE line number
Does anyone know how to get the line number of the cursor position in the BASIC IDE; hopefully also a simple method of moving to a line number? The IDE only supports a few global methods, notably copy/paste and search but, it seems, nothing involving the cursor. However, as https://forum.openoffice....
- Sat Jun 06, 2020 5:18 am
- Forum: Macros and UNO API
- Topic: Is close listener already registered for this doc?
- Replies: 4
- Views: 2048
Re: Is close listener already registered for this doc?
JeJe, thank you for pointing out RuntimeUID. Although I decided on a solution that doesn't involve lookup, another part of my program does. I had been using the document's URL, which is more expensive and not actually needed in this situation.
- Sat Jun 06, 2020 5:10 am
- Forum: Macros and UNO API
- Topic: Is close listener already registered for this doc?
- Replies: 4
- Views: 2048
Re: Is close listener already registered for this doc?
Although keeping a list of the documents for which my library has registered a close listener generally works, program problems can cause the list and documents to get out-of-sync. I have encountered this only when one of my macros under development crashes, but an unrelated macro crash could theore...
- Mon Jun 01, 2020 10:06 pm
- Forum: Macros and UNO API
- Topic: Is close listener already registered for this doc?
- Replies: 4
- Views: 2048
Is close listener already registered for this doc?
Is there a method to determine whether a close listener has already been registered for a given SwXTextDocument, appealing only to the object itself and not the value returned by the doc's addCloseListener method? My library (in ooBasic) handles many documents, which continually open and close. They...
- Sat Apr 04, 2020 2:48 am
- Forum: Calc
- Topic: Keyboard shortcut to drop down the filter list (AutoFilter)
- Replies: 3
- Views: 8610
Re: Keyboard shortcut to drop down the filter list (AutoFilt
Thank you for mentioning the Alt+DownArrow key to open a dropdown list. I was not aware of this and was about to write a macro to do it for my ooBasic dialogs. This does cause a dialog listbox to drop down but subsequent arrow keys (specifically key release event) trigger an execute event, which is ...
- Tue Nov 19, 2019 8:15 pm
- Forum: Macros and UNO API
- Topic: [Solved] Writing text to file without quotes
- Replies: 10
- Views: 4528
Re: [Solved] Writing text to file without quotes
Thank you JeJe for both the strconv suggestion, which worked, and for your overall explanations and examples. You have not only given me a good solution to the read/write symmetry issue but taught me quite a few related things for which I will find additional uses.
- Mon Nov 18, 2019 7:29 pm
- Forum: Macros and UNO API
- Topic: [Solved] Writing text to file without quotes
- Replies: 10
- Views: 4528
Re: [Solved] Writing text to file without quotes
Thank you JeJe for your interesting and informative suggestions. I tried reading the file as binary and it did work as you indicate but all of the text showed up as Kanji. The file is written by external plain text editors and I imagine that it is UTF8.
- Mon Nov 18, 2019 5:27 am
- Forum: Macros and UNO API
- Topic: [Solved] Writing text to file without quotes
- Replies: 10
- Views: 4528
Re: [Solved] Writing text to file without quotes
Thank you for your suggestion JeJe but I'm having trouble with Get (I haven't tried Put). For context, I have a plain text configuration file with each item on one line. I want to read this entire file into an edit control in a dialog for the user to examine and possibly modify. The only way that I ...
- Sun Nov 17, 2019 7:59 am
- Forum: Macros and UNO API
- Topic: [Solved] Writing text to file without quotes
- Replies: 10
- Views: 4528
Re: [Solved] Writing text to file without quotes
I know this is an old discussion but, if you are still following this, thank you RPG. I was tearing my hair out over this and your simple suggestion solved it.
- Mon Nov 04, 2019 7:34 pm
- Forum: Macros and UNO API
- Topic: Library Module As Document
- Replies: 8
- Views: 9290
Re: Library Module As Document
Thank you JeJe for directing me towards BasicIDETools. It does teach what I believe is the only way to do this. For anyone following this discussion, the problem is that the Basic IDE editor, like practically everything in OpenOffice, is derived from XInterface but not additionally any of the text e...