Scripting and open office

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
glurps
Newbie
Posts: 2
Joined: Tue Aug 26, 2008 10:26 am

Scripting and open office

Post by glurps » Tue Aug 26, 2008 2:15 pm

Hello every body,

I'm new to macro scheduler and I am browsing the forum to find answers to my questions!
But Maybe it will be easier to introduce what I want to do and collect your advises!

I want to have a script/executable that once out in a repository and executed :
- create a new open office calculator file
- import in an xls in a sheet (xls file is in the current repository)
- import a comma separated (like CSV) file in another sheet of the same file
(imported file is in the current repository)
- perform some simple computations
- save the resulting file in the current directory

I've tried to record these operation but it does not work very well ...
SelectMenu does not work for open office it seems ...
Is it preferable to use VB?

Thanks in advance for your advises.

Glurps

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Tue Aug 26, 2008 11:14 pm

Could be a number of issues that are causing you trouble,

It may only some timing adjustments to work properly.
Try using Hot Keys vs. mouse movements.
Using the proper Case when sending Hot Keys?

Might be helpful to post your script and show where you are having problems.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

glurps
Newbie
Posts: 2
Joined: Tue Aug 26, 2008 10:26 am

it's better ...

Post by glurps » Wed Aug 27, 2008 7:29 am

Thanks for your answer.

In fact the main trouble was that a file selection in a dialog box was not performed correctly causing the end of the process to go wrong. The file selection problem came from the fact that I was repeating the operation in the same directory ... as this operation was adding a file in the directory, the number of file was different and thus the file selection get wrong ...

So now I have another question:
How do I force the script to apply in the current directory?
I mean, I want the file to be executed in the current directory and to import the files from current directory and save the resulting file in the current directory ...

glurps

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Thu Aug 28, 2008 3:07 am

1. Use the ChangeDirectory command before doing the copy command

OR

2. Use the full path. You can set the path once as a variable, then put the variable in front of the file name(s).
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

Me_again
Automation Wizard
Posts: 1101
Joined: Fri Jan 07, 2005 5:55 pm
Location: Somewhere else on the planet

Post by Me_again » Thu Aug 28, 2008 1:24 pm

If "current directory" means the one where the script is running, then there is a system variable SCRIPT_DIR = Directory of running script you can use.

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts