Download this file

OpenHelperScript.txt    72 lines (53 with data), 2.7 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
== Starting native applications
It is sometimes difficult to start a native application on a result
document, especially when the result comes from a container file (ie: email
folder file, chm file).
The problem is that native applications usually expect at most a file name
on the command line, and sometimes not even that (emailers).
The _Open parent documents_ link in the result list right click menu is
sometimes useful in this situation (e.g.: +chm+ files).
In some other cases it may help that Recoll does make a lot of data
available to the application. This data may have to be pre-processed in a
script before calling the actual application.
Details about configuring how the native application or script are called
are given with the
link:http://www.recoll.org/usermanual/usermanual.html#RCL.INSTALL.CONFIG.MIMEVIEW[description of the mimeview configuration file]
Information about
link:http://www.recoll.org/usermanual/usermanual.html#RCL.INSTALL.CONFIG.FIELDS[configuring
customised fields] may also be useful in combination.
=== Example
This is a simple example, because it does not need to use special
fields. It just shows how to solve a simple issue by using an intermediary
script. The problem is due to the fact that thunderbird's +-file+ option
won't open a file if the extension is not '.eml'. Jorge, the kind Recoll
user who supplied the example stores his email in Maildir++ format, the
file names have no extension, so an intermediary script is necessary to get
thunderbird to open them:
Note that this only works with messages stored in Maildir or MH format (one
message per file). As far as I know, there is no way to get Thunderbird to
open an arbitrary mbox file.
The 'recoll-thunderbird-open-file' script:
----
#!/bin/sh
cp $1 /tmp/$$.eml
thunderbird -file /tmp/$$.eml
----
Create the file in an editor, save it somewhere, and make it executable
(`chmod +x recoll-thunderbird-open-file`).
The mail line in the '~/.recoll/mimeview' file:
----
[view]
message/rfc822 = recoll-thunderbird-open-file %f
----
If the place where you saved the script is not in your PATH, you will need
to use the full path instead of just the script name, as in
----
[view]
message/rfc822 = /home/me/somewhere/recoll-thunderbird-open-file %f
----
You should then be able to open the messages in Thunderbird, which is
useful, for example, to handle the attachments.
With recent Recoll versions, if using the normal option of letting the
Desktop chose the _Open_ application to use (_Use Desktop default_),
you should also add +message/rfc822+ to the exceptions, and the whole
thing is probably more easily done from the Recoll GUI.