launching thunderbird

Hello,
I’m launching thunderbird on mac os from Xojo, actually I compose the message like this

Dim sh as new shell
Dim command as String

command ="/Applications/Thunderbird.app/Contents/MacOS/thunderbird -compose to=‘john@example.com’,subject=‘dinner’,body=‘How about dinner tonight?’,attachment=file:///’/Users/Desktop/Temporals/File.pdf’"

sh.execute command

it works fine but there is a problem. The xojo program does not continue running until thunderbird is closed. Is there anyway to continue program running without exit Thunderbird. I understant that the issue will be any program.

Thank you

If that is the only code in your program… what do expect “continue to run” to be doing?

The shell command will spawn Thunderbird, and both Xojo and Thunderbird will run until such time as they have deemed there function complete. Not sure what else you expect?

I’m sorry I didn’t explain very well. I mean the xojo program remains frozen util thunderbird is not closed.

It sounds like you want to run the Shell in Asynchronous mode so that it does not wait for the command to finish.

https://documentation.xojo.com/api/deprecated/deprecated_class_members/shell.mode.html

Yes, it is. this is that I want
Unfortunately shell doesn’t launch thunderbird in mode = 2 nor mode = 3.

open /Applications/Thunderbird.app --args --compose to=‘john@example.com’,subject=‘dinner’,body=‘How about dinner tonight?’,attachment=file:///’/Users/Desktop/Temporals/File.pdf

man open
OPEN(1) BSD General Commands Manual OPEN(1)
NAME
open – open files and directories

SYNOPSIS
open [-e] [-t] [-f] [-F] [-W] [-R] [-n] [-g] [-j] [-h] [-s sdk]
[-b bundle_identifier] [-a application] file … [–args arg1 …]

Thank you Horst Jehle.

open -a /Applications/Thunderbird.app/Contents/MacOS/thunderbird --args --compose to=‘sdfsdf@ffff.cat’

it works fine as log as thunderbird is not running.

if thunderbird is running the “compose” is not working it does nothing. Any idea ?

Use additional argument “-n”

see man open:
-n Open a new instance of the application(s) even if one is already run-
ning.

If you’re just trying to compose an email you can use ShowURL and the url for emails. The only thing it can’t do is attach files.

ShowURL("mailto:hello@example.com?subject=New+Email&body=Hello!")

Also you can start the application in the background:

-j Launches the app hidden.

@Jaume Jaume - have you tried putting a & at the end of your original command?