Quantcast
Channel: Adobe Community: Message List - InDesign Scripting
Viewing all articles
Browse latest Browse all 37788

Execute exe (email client) from javascript

$
0
0

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.


Viewing all articles
Browse latest Browse all 37788

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>