[Users] Open Attachments

Chainsaw chainsawuser at cfl.rr.com
Mon Sep 27 22:08:43 CEST 2021


Brian,

I actually have a few different ways, similar in concept and all limited, but I like the simplest way the best.
I do not like the workflow, but it works well.

So, I assume Debian has a command prompt that will open files by association.
In other words at the command prompt, if you type c:\path\mypdf.pdf, and hit Enter it will open the file in the associated pdf viewer (jpg, txt, png, etc.).
(If not I can tell you how to work around that)

1) Create an action equivalent to this:
replacing ["c:\windows\system32\cmd.exe" /c] with Debian equivalent.

Menu name: OpenAttach
  Command: "c:\windows\system32\cmd.exe" /c "%u" &

Note: I do not think this is documented.
      "%u" (also "%s") acts like a switch.
      If the argument has no spaces, there will be no surrounding quotes.
      If the argument has spaces, there will be surrounding quotes.
      If you just use %u, the command will fail if there are spaces.

2) Create the Compose Window button as shown in attachment.

3) To open an attachment:
a) add attachments as usual using ctrl-m or dragging into compose window.
b) in Attachments tab double-click on an attachment.
c) highlight full path in Path field (or CTRL-A), then CTRL-C, then Cancel.
d) select OpenAttach button, CTRL-V, then Enter.
Note: If you save to draft folder, close compose window and open draft, the attachment path is now in C:\...\Roaming\Claws-mail\mimetmp\, but still works.

Works fine in Windows.
I did write a batch script that does error checking, opens the passed filename by targeting the program of my choice for each extension (no association required), and closes cmd.exe in the background.
So if you can write scripts, you can really expand on this.

Hope this might help.
Chainsaw
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenAttach Button.jpg
Type: image/jpeg
Size: 79745 bytes
Desc: not available
URL: <http://lists.claws-mail.org/pipermail/users/attachments/20210927/13832a7e/attachment-0001.jpg>


More information about the Users mailing list