Copy link to clipboard
Copied
I am trying to convert my VBScript that export and attach a jpeg to Thunderbird email client in Javascript, but I am stuck on the execute of thunderbird exe.
This is what I am doing in VBScript and it works very well:
Set s = CreateObject("WScript.Shell")
s.run chr(34) & "C:\Program Files (x86)\Mozilla Thunderbird\thunderbird.exe"& chr(34) & " -compose " & "attachment=" & myFileName
The only function I've found in Javascript is .execute(); but I have no idea how to pass the parameter "-compose attachment=myFileName"
var myFile = new File("C:\Program Files (x86)\Mozilla Thunderbird\thunderbird.exe");
myFile.execute();
Any attempt to add with escaped doubled quote \" in the parameters or create a string with it does not works, looks like .execute(); only can start the main program
I did also a dos syntax for the filename without spaces but it can start only Thunderbird and don't accept -compose param (C:\\PROGRA~2\\MOZILL~3\\THUNDE~1.EXE)
Any idea how can I start this in javascript?
"C:\Program Files (x86)\Mozilla Thunderbird\thunderbird.exe" -compose " & "attachment=" & myFileName
Thanks for your help.
Copy link to clipboard
Copied
Hi,
run your VB via doScript in ExtendScript
http://jongware.mit.edu/idcs5/pc_Application.html#doScript
addition:
use ScriptLanguage.VISUAL_BASIC which is supported although not in the documentation ...