Issue 75506 - Impossible to run a script from the IDE with Tools menu
Summary: Impossible to run a script from the IDE with Tools menu
Status: ACCEPTED
Alias: None
Product: App Dev
Classification: Unclassified
Component: scripting (show other issues)
Version: 3.3.0 or older (OOo)
Hardware: All Windows XP
: P3 Trivial
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords: oooqa
Depends on:
Blocks:
 
Reported: 2007-03-18 13:49 UTC by bmarcelly
Modified: 2017-05-20 11:27 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description bmarcelly 2007-03-18 13:49:38 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.
Comment 1 eberlein 2007-03-19 11:05:57 UTC
Confirming for 2.1
Comment 2 epochiero 2007-03-20 22:04:45 UTC
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.
Comment 3 bmarcelly 2007-03-21 09:33:44 UTC
"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.
Comment 4 epochiero 2007-03-21 17:57:25 UTC
I've reproduced the steps, and I don't find any errors. I'm using OO 2.2rc3.
Comment 5 kpalagin 2007-03-22 01:19:58 UTC
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.
Comment 6 bmarcelly 2007-03-22 10:23:09 UTC
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 
Comment 7 noel.power 2007-03-22 11:15:11 UTC
-> 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 )
Comment 8 ab 2007-03-23 09:16:57 UTC
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.
Comment 9 bmarcelly 2007-03-29 12:41:48 UTC
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
Comment 10 ab 2007-03-29 12:58:46 UTC
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.
Comment 11 Mathias_Bauer 2007-12-04 14:57:24 UTC
basic and scripting issues now should be assigned to component "scripting"
Comment 12 Martin Hollmichel 2007-12-07 12:13:22 UTC
set target to 3.x according to http://wiki.services.openoffice.org/wiki/Target_3x
Comment 13 Marcus 2017-05-20 11:27:58 UTC
Reset assigne to the default "issues@openoffice.apache.org".