Apache OpenOffice (AOO) Bugzilla – Issue 75506
Impossible to run a script from the IDE with Tools menu
Last modified: 2017-05-20 11:27:58 UTC
Steps to reproduce: 1 - Open a new Writer document 2 - open the Basic IDE 3 - in the IDE window, open the menu Tools > Macros > Run macro... 4 - choose any script (Basic, Beanshell, Javascript, etc) from OpenOffice.org macros, e.g. one of the HelloWorld scripts, or choose any Basic script inside the current document. Execute it. You get a script error message. 5 - from the Writer window, open the menu Tools > Macros > Run macro... and repeat step 4 : the script works.
Confirming for 2.1
I don't think this is actually an issue. You're trying to run a script when there isn't any open documents, that is, the script doesn't know what to do, that's the reason why you're getting an error message. For example, create a new Impress document, and try to run the Capitalise script. You will get an error message, but if you select a piece of text of any Writer document, it will work.
"You're trying to run a script when there isn't any open documents, that is, the script doesn't know what to do" No. Read again thee steps to reproduce. The problem appears on any script, even a Basic script doing nothing, like Sub Main End Sub Try it for example on a new document where you have just created an empty macro.
I've reproduced the steps, and I don't find any errors. I'm using OO 2.2rc3.
No errors here with 2.2RC2 and it macro executed from IDE even performed expected action. It seems to me that error or no error is dependant on the order different dialogs and windows are opened. Please specify how you are opening IDE.
I have OOo 2.0.4 on Win XP, I did not test on 2.2RC. But eberlein says it confirmed on 2.1. An error message is systematic with Basic macros in a document or the various HelloWorld scripts of "OpenOffice.org Macros", but only when you start the script with Tools > Macros > Run Macros within the IDE window. Macros from "My Macros" run correctly with the same procedure. Simplest test : 1 - load OpenOffice Writer : there is a new Writer document "Untitled1" 2 - Tools > Macros > Organize Macros > OpenOffice.org Basic Create a new macro in Standard library of the "Untitled1" document The IDE window opens, showing the macro : REM ***** BASIC ***** Sub Main End Sub 3 - From the IDE window : Tools > Macros > Run Macros... (wait for Java to load...) 4 - In the Macro Selector, develop the branch : Untitled1 > Standard > Module1 A macro named Main appears, selected 5 - click on Run button. Message : A Scripting Framework error occurred while running the Basic script vnd.sun.star.script:Standard.Module1.Main?language=Basic&location=document. Message:BasicProviderImpl::getScript: no script! If I run the macro through Tools > Macros > Organize Macros > OpenOffice.org Basic, it works
-> ab for what it is worth seems to work on my 2.2ish build ok ( on windows & linux ), perhaps this was fixed as a result of another bug ( although I don't remember anything changing that would affect this )
Confirmed on src680 m203 Usually problems like this are related to document activation. I don't consider this task as too serious, as many document macros will fail anyway when started without the document beeing active. OOo 2.x for now.
Confirming on 2.2.0 ab wrote : I don't consider this task as too serious, as many document macros will fail anyway when started without the document beeing active. It is not a blocking problem, but the user cannot understand why, from the IDE, the same macro does not run from Tools > Macros > Run Macros... , whereas it runs OK from Tools > Macros > Organize Macros > OpenOffice.org Basic
ab->bmarcelly: I did not say, it's no bug, I did only say that I don't consider it as very serious for the given reason... :-) Otherwise I would have changed priority to P4 anyway.
basic and scripting issues now should be assigned to component "scripting"
set target to 3.x according to http://wiki.services.openoffice.org/wiki/Target_3x
Reset assigne to the default "issues@openoffice.apache.org".