I need Macro "shell " syntax help

Hi All,

Would some kind person please enlighten me as to the proper syntax for the macro “shell” command?

This is the command I want to run:
$ thunderbird -compose “to=xxxx@zoho.com,subject=test,html,body=‘abc’,attachment=file:///home/xxx/.local/share/icons/hicolor/16x16/apps/7765_winebrowser.0.png”

This is what bombs out on me:
shell("/usr/bin/thunderbird", 1, ‘-compose to=xxx@zoho.com,subject=test,html,body=abc,attachment=file:///home/xxx/.local/share/icons/hicolor/16x16/apps/7765_winebrowser.0.png’, false)

What am I doing wrong?

Many thanks,
-T

Hello,

In future please be so kind to include OS & specific LO version you are dealing with. This can become important.

First you should not need /usr/bin/ to specify Thunderbird location.

Set the required parameters as a String in a variable before running Shell. Then in the Shell statement add them in:

sMailParams = "to=xxxx@zoho.com,subject=test,html,body='abc',attachment=file:///home/xxx/.local/share/icons/hicolor/16x16/apps/7765_winebrowser.0.png"
shell("/usr/bin/thunderbird -compose " & sMailParams)

Have tested this directly from Basic IDE & from push button in Calc (Mint 18.3 with LO v6.1.0.3) - of course my test had different .png file & file location.

Edit:

Running all in one line will also work:

shell("/usr/bin/thunderbird -compose to=xxxx@zoho.com,subject=test,html,body='abc',attachment=file:///home/xxx/.local/share/icons/hicolor/16x16/apps/7765_winebrowser.0.png")

Thank you!

first iteration will be Fedora 28, second iteration will be Windows Nein, oops, Windows Ten.

If this has helped, please help others to know the question has been answered by clicking on the :heavy_check_mark: in upper left area of answer which satisfied the question.

It “seems” helpful. I won’t be able to test until tomorrow. i will get back.

shell("/usr/bin/thunderbird -compose " & sMailParams)

Why did you use a “&” instead of a “+” to join the string together?

Preferred method.

Very nice. However, I can’t add two or more attachments to my mail. Do you have any idea?

@lodovi Please see this post for answer → multiple attachments from shell