Ask Your Question
0

I need Macro "shell " syntax help

asked 2018-10-18 20:32:11 +0200

Todd2 gravatar image

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

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2018-10-18 21:35:43 +0200

Ratslinger gravatar image

updated 2018-10-18 22:10:47 +0200

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")
edit flag offensive delete link more

Comments

Thank you!

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

Todd2 gravatar imageTodd2 ( 2018-10-18 22:12:46 +0200 )edit

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

Ratslinger gravatar imageRatslinger ( 2018-10-18 22:16:27 +0200 )edit

It "seems" helpful. I won't be able to test until tomorrow. i will get back.

Todd2 gravatar imageTodd2 ( 2018-10-18 23:34:53 +0200 )edit

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

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

Todd2 gravatar imageTodd2 ( 2018-12-01 04:37:57 +0200 )edit

Preferred method.

Ratslinger gravatar imageRatslinger ( 2018-12-01 05:30:04 +0200 )edit

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

lodovi gravatar imagelodovi ( 2019-05-05 21:56:32 +0200 )edit

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

Ratslinger gravatar imageRatslinger ( 2019-05-11 06:51:48 +0200 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2018-10-18 20:32:11 +0200

Seen: 64 times

Last updated: Oct 18 '18