open files automatically

Good morning from Japan
Maybe (I do not remember exactly) I did ask the same question years ago.

Is there a trick to tell LibreOffice, in particular Calc, to open files
automatically?
For the last 15 years or so I have been using Lotus 123 to keep track of
simple tasks like appointments, patient names etc.
But this software is now too old to work any longer (so the computer
tells me).

Lotus 123 allows to specify a folder and then opens the files therein
automatically whenever the software is started.
For those administrative tasks, a set of 2-3 files, this is VERY convenient.

I would like to convert those 123-files into Calc format and have Calc
open them *automatically* whenever I start Calc.

Is that possible?
If so, how do you do that?

Thank you.
Thomas

Is there a trick to tell LibreOffice, in particular Calc, to open files automatically?

Not that I know of. (Perhaps someone knows better.)

Lotus 123 allows to specify a folder and then opens the files therein automatically whenever the software is started. For those administrative tasks, a set of 2-3 files, this is VERY convenient. I would like to convert those 123-files into Calc format and have Calc open them *automatically* whenever I start Calc.

It's worth mentioning that you cannot "start Calc": that's not how LibreOffice works. You can do either of two different things: either start LibreOffice or start LibreOffice with a new, empty spreadsheet. And that tells you something about your problem: if you could do what you wanted, there would be no way to prevent your spreadsheet documents being opened if you wanted to start LibreOffice to edit a text file (or, as you would say, "start Writer") or presentation or whatever instead.

There are many workarounds, which depend on your operating system - which you have kept a secret. (You appear to be using Windows XP.)

o Your operating system will probably offer a way to start programs at start-up - when you log in, that is. You could put your document files (or possibly shortcuts to them?) in the appropriate folder.

o You could put your documents or shortcuts to them somewhere convenient, such as on the desktop or in the start menu, and then click on these when you need the documents open.

o (Probably best) Put the documents in a convenient folder. (You've done that already.) Create a shortcut to this on the desktop or in the start menu. When you need to open the documents, (1) click or double-click the shortcut to open the folder, (2) select all the document files together (using Edit | Select All or Ctrl+A?), and (3) press Enter to open all the documents (whether or not LibreOffice is already running).

I trust this helps.

Brian Barker

I will try this last approach and see, if I can get it to work.
LibreOffice -> I use it on all my machines:
Windows XP (about to be decommisioned)
Windows 7
Windows 8.1
kubuntu 14.04
xubuntu 14.04
Mint 17, Cinnamon

The "problem" is naturally everywhere the same.

Is there a trick to tell LibreOffice, in particular Calc, to open files automatically?

Not that I know of. (Perhaps someone knows better.)

Lotus 123 allows to specify a folder and then opens the files therein automatically whenever the software is started. For those administrative tasks, a set of 2-3 files, this is VERY convenient. I would like to convert those 123-files into Calc format and have Calc open them *automatically* whenever I start Calc.

It's worth mentioning that you cannot "start Calc": that's not how LibreOffice works. You can do either of two different things: either start LibreOffice or start LibreOffice with a new, empty spreadsheet. And that tells you something about your problem: if you could do what you wanted, there would be no way to prevent your spreadsheet documents being opened if you wanted to start LibreOffice to edit a text file (or, as you would say, "start Writer") or presentation or whatever instead.

I have no problem starting Calc nor opening several spreadsheets "automatically". I select the sheets I open in Dolphin (or any other file manager) and right-click on the selection then select "Open with". Calc is the default program to open .ods documents so they all open.

Since the OP wants a job to run at startup, simply use the command-line to do the job:
    libreoffice --calc -o <file1> -o <file2> ...

Put that into a script or a link to a script in your "Autostart" folder (.kde/Autostart on my KDE system).

To open all the files in a folder, just use a loop like this:
   for f in *; do; libreoffice --calc -o $f; done

We don't need no stinking features when we've got a real command line. :slight_smile:

Hi :slight_smile:
If the folder contains some spreadsheets and some other things and you only
want to open the spreadsheets then the fastest way i can think of is to use
the file-browser to arrange/sort the files "by type" rather than by name or
date. That might make it easier to select them all.

I think other people have had better suggestions already though. I was
wondering if it might be possible to "script it" but kinda assumed it
probably wouldn't be at all easy = so i like Gary's suggestion! :slight_smile:
Regards from
Tom :slight_smile:

​Nitpicking, but for that you can just do:
$ libreoffice ​*.ods

The -o is only needed if you want to open template for edition, and --calc
is redundant if the file are spreadsheet :slight_smile:
(also, this will be noticeably more efficient: your for loop start a new
process for every file, which can lead to race condition and stuff).

This is only if your shell is up to the task though. On windows, using
wildcard like * doesn't work with libreoffice. You can still open multiple
file with a single command by passing them one after another. But, on
windows, you also have to pass the full soffice.exe path to the command
line as it is not in the path :\

Thanks Tom. If the OP is using Windows, it should still work although they may not be able to do the file loop. The raw command should work on any OS so it may just be a matter of using lots of -o's or running the command multiple times, once per file.

Is there a trick to tell LibreOffice, in particular Calc, to open files automatically?
Lotus 123 allows to specify a folder and then opens the files therein automatically whenever the software is started. For those administrative tasks, a set of 2-3 files, this is VERY convenient. I would like to convert those 123-files into Calc format and have Calc open them *automatically* whenever I start Calc.

I have no problem starting Calc nor opening several spreadsheets "automatically". I select the sheets I open in Dolphin (or any other file manager) and right-click on the selection then select "Open with". Calc is the default program to open .ods documents so they all open.

It's easy to solve a problem by changing the problem! This isn't what the questioner means by "automatically". He no doubt understands the idea of file association that you describe here (when you surely don't need "open with" anyway?). Instead, he wants a specific set of files to open without their being selected each time: that's his meaning of "automatic".

Since the OP wants a job to run at startup, simply use the command-line to do the job:
   libreoffice --calc -o <file1> -o <file2> ...

Put that into a script or a link to a script in your "Autostart" folder (.kde/Autostart on my KDE system).

To open all the files in a folder, just use a loop like this:
  for f in *; do; libreoffice --calc -o $f; done

No, he doesn't want it at start-up, it seems, but instead when he starts LibreOffice. But something like this as a desktop shortcut or menu item (not in the start-up folder) is no doubt ideal.

Brian Barker

​Since we're talking windows (I missed that information from previous post,
sorry), making a shortcut that open multiple files is trivial. ​The only
"obstacle" would be to easily get all the file paths.

To create the shortcut (on the desktop or anywhere else really): in the
start menu, go to the LibreOffice entry (no need to use "calc"
specifically), and right-click-drag (drag with the right click) where you
want the shortcut. When releasing the mouse button, a menu show up giving
the occasion to create a shortcut.

At this point, the new shortcut can be edited (right click->properties). In
the "target" box, there's something that end with soffice.exe". You can put
file names after this. For example, the whole box could read like this
(including the quotes):

"C:\Program Files (x86)\LibreOffice 4\program\soffice.exe"
"E:\Documents\smth1.ods" "E:\smth2.odt"

Then click ok. That link will cause LibreOffice to open all the given
document.

As a final hint, there's a way to *easily* get all the files you want, with
their path.
- Open a shell (no, it won't hurt) by pressing Win+R, and typing "cmd" as
the command
- In the shell, type (without the quotes of course): "more >
Desktop\filelist.txt"
​- Drag'n'drop all your files one by one in the shell window​, pressing
space after each files
- When done, press return, then ctrl+c
- type "exit" to leave the shell

At this point, you have a file named "filelist.txt" on your desktop,
containing all files with full path. You just have to copy/paste this
string in your shortcut :slight_smile:

​As said by others, I'd rather not see LibreOffice itself getting this
"feature". It is something that can be achieved rather easily in any OS.
One could argue that it's even *the point* of modern systems...​

This is still not what the OP wants.
It is possible to come close by saving the files when you are finished editing but keeping them open.
Then kill Libreoffice (not File>Exit). On restarting LO next time it should ask to restore the files you had open.

Could also file a bug as a feature request
steve

What operating system?

jonathon

What he wants to know, is how to edit
«
#!/bin/sh

Hi Toki,

That is a Linux shell script is it not? I think it's been established that the OP is a Windows user. Please identify the Windows equivalent file as well as the quoted Linux file. I am guessing that it exists in the user's file system once LO is installed and that it is invoked when execution of soffice begins.

You speak of editing the script so that it opens the specific calc (.ods?) files. I have not exhaustively examined the 3 1/2 printed pages the script occupies so pardon me if the next question is answered in an obvious manner within the script. Where does one look in the script for the code to open certain "calc" files?

This is a very interesting discussion.

I think it's been established that the OP is a Windows user.

FWIW, the OP said they used both Windows and Linux.

Please identify the Windows equivalent file as well as the quoted Linux

file

The quoted Linux file is
/opt/libreoffice4.4/program/soffice

Inasmuch as I no longer do Windows, I have no idea where the equivalent
file is found in Windows, nor what it is called.

I do know that on my old DosBox, I used to be able to do things like
«for f in *; do; libreoffice --calc -o $f; done».
Not for LibreOffice, since it was not compiled for Dos,^1 but I could do
it with other programs. I have no idea how much of that was due to
modifications made to my Dosbox. (My most frequently used manual for
that system was O'Reilly's Referee book. I don't remember which version
of BSD or Unix it was written for. True to its roots in Dos, more than
once a shell script tripped up, because I used "/" instead of "\".)

In theory, something like that should be doable on Windows. In practice,
maybe not.

I am guessing that it exists in the user's file system once LO is installed and that it is invoked when execution of soffice begins.

C:\Programs\LibreOffice\program\soffice would be my guess. But I have
pretty much forgotten most of what I knew about Windows configuration,
and file placement.

You speak of editing the script so that it opens the specific calc (.ods?) files.

It's your standard shell script, albeit with a couple of complications
thrown in, for good measure.

Where does one look in the script for the code to open certain "calc" files?

I've forgotten which lines I changed, when i wanted that specific
functionality. :frowning:

It was/is much simpler to simply alias «for f in *; do; libreoffice
--calc -o $f; done» than modify that shell script.
Wondering now if I simply renamed soffice to soffice1, and named the
shell script soffice.

Point is, what the OP wants to do can be done, at least in a *Nix
environment.

....

In theory, something like that should be doable on Windows. In practice,
maybe not.

I don't use windows routinely now - but I did (and still do) use perl an awful lot to make up for the system's own scripting deficiencies. It wouldn't be hard to write one that takes a directory as argument, looks up all the relevant files therein, and runs an appropriate soffice command to open them. It could even be portable, with care :slight_smile:

(No doubt python would be preferred these days.)

Good afternoon.
I do not want to be rude, but THAT is definitely NOT want I want(ed).
I was looking for a SIMPLE / EASY / PRACTICABLE way to open files.
As described originally:
1) Lotus 123 -> specific folder (ONCE)
2) Put the files I want to open in there.
3) Every time after that, when I open 123 spreadsheet, those 2-3 files open.

Job done. No questions asked. No editing or programming. Quick and painless.
THAT is, what I was looking for.

In case there is a stand-alone spreadsheet program (NOT Excel!) that can do this trick ..
I would love to learn its name.

Hi Thomas

Thomas Blasejewicz-3 wrote

In case there is a stand-alone spreadsheet program (NOT Excel!) that can
do this trick ..
I would love to learn its name.

Interesting feature. That wasn't available in the Lotus DOS days probably
because you could only open one file at a time :slight_smile:

The short answer is: LibreOffice does not have that feature. I am not aware
of any free or commercial spreadsheet that does that.

The long answer:

Since LibreOffice is a free open source software you can ask for that
feature to be added by submitting an Enhancement Request in the TDF Bugzilla
https://bugs.documentfoundation.org/

It is submitted as any other bug. Choose Calc(*) in the Component box and
"enhancement" in the Severity box.
Obviously this will be added to the list and is depending on a developer
getting interested on your problem.

Alternatively you can set a Bounty (e.g. https://www.bountysource.com/), try
Crowdfunding (e.g. https://freedomsponsors.org/) or pay a company like
Collabora to add the feature
(https://libreoffice-from-collabora.com/consultancy/)

Note: I'm not affiliated with TDF or any of the sites mentioned. There are
probably other companies/sites/solutions.

Hope this helps.

(*) Actually because LibreOffice can open many file formats this could be
added as a General feature where you could have text, spreadsheets,
presentations, etc in the Startup folder that would open when LibreOffice
opens :wink: I bet quite a few people would find this feature interesting!

I don't understand why any application should do this.
Put your files into your assumed auto-start folder. I would use links
instead of the real files.
Open that folder, hit Ctrl+A and Enter to open all the files with the
default application.

Hi Toki,

That is a Linux shell script is it not? I think it's been established that
the OP is a Windows user.

I quote a section from the OP's second post in this thread:
”Windows XP (about to be decommisioned)
Windows 7
Windows 8.1
kubuntu 14.04
xubuntu 14.04
Mint 17, Cinnamon”

So he use Windows, but not only.

Please identify the Windows equivalent file as well as the quoted Linux

That was possible in OS/2, but I haven't seen it anywhere else. With
OS/2, you could create a "Work Area" folder and whenever that folder was
opened, whatever was in it would also open.