Page 2 of 2
Re: Add Send to E-Mail Recipient to Tool Bar
Posted: 17 May 2011 14:32
by Stefan
Interesting
i just did an test for the longest string i can send to command interpreter:
Code: Select all
$XP = strrepeat("X", 2042);
run "cmd /k echo $XP-";
Code: Select all
$Win7 = strrepeat("X", 8151);
run "cmd /k echo $Win7-";
-
But in XP DOS-Box i can copy in "ECHO 8191XXX" and get an good result.
"8191XXX" is an 8191 char long string.
::text strrepeat("X", 8191)
Re: Add Send to E-Mail Recipient to Tool Bar
Posted: 17 May 2011 15:02
by Stefan
Idea: if you have setup your system to an unicode code page for DOS-Box,
you have even only an half of this amount available for strings because each char takes two bytes?
I use non-unicode cp:
C:\>chcp
850
or
1252
Can someone answer this please?
Re: Add Send to E-Mail Recipient to Tool Bar
Posted: 17 May 2011 23:00
by IMPVGO
serendipity wrote:OK, here is another way using command prompt which supports longer string length. Again not sure what that number is.
Code: Select all
//Attach to Thunderbird
//Get item's path and names
$items=chr(39).get("SelectedItemsPathNames",",").chr(39);
//Get item's names
$itemnames=chr(39).get("SelectedItemsNames",", ").chr(39);
//Insert values into Thunderbird syntax
$TB_Syntax= chr(34)."subject=$itemnames,body=$itemnames,attachment=$items".chr(34);
//Attach selected files to thunderbird's compose window
//This method uses command prompt.
run "cmd /c cd /d C:\Program Files\Mozilla Thunderbird\ & thunderbird -compose $TB_Syntax";
Serendipity: Now this code is perfect. I can attach all the files I need without any problem (as long as I do not do over about 30 files - that will never need anyways). All files are attached and listed in the body and subject of the e-mail, without any of the problems I was having before. Thank-you again.
There is only one last question. Is there a way to name each file in separate lines in the body of the e-mail??... Eg.
filnename.pdf
filename.tif
filename.pdf
etc.
Thank-you!!!
Re: Add Send to E-Mail Recipient to Tool Bar
Posted: 18 May 2011 07:09
by serendipity
IMPVGO wrote:There is only one last question. Is there a way to name each file in separate lines in the body of the e-mail??... Eg.
filnename.pdf
filename.tif
filename.pdf
etc.
Thank-you!!!
Try this:
Code: Select all
//Attach to Thunderbird
//Get item's path and names
$items=chr(39).get("SelectedItemsPathNames",",").chr(39);
//Get item's names
$itemnames=chr(39).get("SelectedItemsNames",", ").chr(39);
//Get item's names for body
$itemnamesbody=chr(39).get("SelectedItemsNames","<br>").chr(39);
//Insert values into Thunderbird syntax
$TB_Syntax= chr(34)."subject=$itemnames,body=$itemnamesbody,attachment=$items".chr(34);
//Attach selected files to thunderbird's compose window
//This method uses command prompt.
run "cmd /c cd /d C:\Program Files\Mozilla Thunderbird\ & thunderbird -compose $TB_Syntax";
Re: Add Send to E-Mail Recipient to Tool Bar
Posted: 18 May 2011 16:53
by IMPVGO
serendipity wrote:
Try this:
Code: Select all
//Attach to Thunderbird
//Get item's path and names
$items=chr(39).get("SelectedItemsPathNames",",").chr(39);
//Get item's names
$itemnames=chr(39).get("SelectedItemsNames",", ").chr(39);
//Get item's names for body
$itemnamesbody=chr(39).get("SelectedItemsNames","<br>").chr(39);
//Insert values into Thunderbird syntax
$TB_Syntax= chr(34)."subject=$itemnames,body=$itemnamesbody,attachment=$items".chr(34);
//Attach selected files to thunderbird's compose window
//This method uses command prompt.
run "cmd /c cd /d C:\Program Files\Mozilla Thunderbird\ & thunderbird -compose $TB_Syntax";
This works flawlessly. Is it possible to add the word Emailing: before the names of the files on the subject of the e-mail?? I have tried this, but it does not come out okay. I tried:
"subject=Emailing: $itemnames, body etc., but in the subject it only appears the name of the first file.
And the last one, that I do not even have idea if it is possible is to number the files in the body of the e-mail. Eg.:
1) file.pdf
2) file.tif
3) file.jpg, etc.
I have appreciated very much your help, because now I have a button in my toolbar that attached the selected files to my e-mail client. Thank-you again.
Impvgo
Re: Add Send to E-Mail Recipient to Tool Bar
Posted: 18 May 2011 19:34
by serendipity
IMPVGO wrote:serendipity wrote:
Try this:
Code: Select all
//Attach to Thunderbird
//Get item's path and names
$items=chr(39).get("SelectedItemsPathNames",",").chr(39);
//Get item's names
$itemnames=chr(39).get("SelectedItemsNames",", ").chr(39);
//Get item's names for body
$itemnamesbody=chr(39).get("SelectedItemsNames","<br>").chr(39);
//Insert values into Thunderbird syntax
$TB_Syntax= chr(34)."subject=$itemnames,body=$itemnamesbody,attachment=$items".chr(34);
//Attach selected files to thunderbird's compose window
//This method uses command prompt.
run "cmd /c cd /d C:\Program Files\Mozilla Thunderbird\ & thunderbird -compose $TB_Syntax";
This works flawlessly. Is it possible to add the word Emailing: before the names of the files on the subject of the e-mail?? I have tried this, but it does not come out okay. I tried:
"subject=Emailing: $itemnames, body etc., but in the subject it only appears the name of the first file.
And the last one, that I do not even have idea if it is possible is to number the files in the body of the e-mail. Eg.:
1) file.pdf
2) file.tif
3) file.jpg, etc.
I have appreciated very much your help, because now I have a button in my toolbar that attached the selected files to my e-mail client. Thank-you again.
Impvgo
This is possible. I hope you are learning some scripting to take full advantage of what XY can do. Also, I would appreciate if you can contribute to XY in anyway possible, including writing reviews and spreading the word. And ofcourse if you are evaluating this product, consider buying it.
And here's the script:
Code: Select all
//Attach to Thunderbird
//Get item's path and names
$items=chr(39).get("SelectedItemsPathNames",",").chr(39);
//Get item's names
$itemnames=chr(39).get("SelectedItemsNames",", ").chr(39);
//Get item's names for subject
$itemsubject=chr(39)."Emailing: ".get("SelectedItemsNames",", ").chr(39);
//Get item's names for body
$itemnamesbody=chr(39).report("{#}) {name}<br>", 1).chr(39);
//Insert values into Thunderbird syntax
$TB_Syntax= chr(34)."subject=$itemsubject,body=$itemnamesbody,attachment=$items".chr(34);
//Attach selected files to thunderbird's compose window
//This method uses command prompt.
run "cmd /c cd /d C:\Program Files\Mozilla Thunderbird\ & thunderbird -compose $TB_Syntax";
Re: Add Send to E-Mail Recipient to Tool Bar
Posted: 18 May 2011 20:55
by IMPVGO
serendipity wrote:
This is possible. I hope you are learning some scripting to take full advantage of what XY can do. Also, I would appreciate if you can contribute to XY in anyway possible, including writing reviews and spreading the word. And ofcourse if you are evaluating this product, consider buying it.
And here's the script:
Code: Select all
//Attach to Thunderbird
//Get item's path and names
$items=chr(39).get("SelectedItemsPathNames",",").chr(39);
//Get item's names
$itemnames=chr(39).get("SelectedItemsNames",", ").chr(39);
//Get item's names for subject
$itemsubject=chr(39)."Emailing: ".get("SelectedItemsNames",", ").chr(39);
//Get item's names for body
$itemnamesbody=chr(39).report("{#}) {name}<br>", 1).chr(39);
//Insert values into Thunderbird syntax
$TB_Syntax= chr(34)."subject=$itemsubject,body=$itemnamesbody,attachment=$items".chr(34);
//Attach selected files to thunderbird's compose window
//This method uses command prompt.
run "cmd /c cd /d C:\Program Files\Mozilla Thunderbird\ & thunderbird -compose $TB_Syntax";
I am sure trying to learn scripting, although it is difficult. In any case, this has been a good learning experience. I had been trying to put-up a script with these characteristics for a while, but nothing concrete had come up. I sure will be making positive comments about XYPlorer, as I genuinely think is the best file manager there is, and if you know scripting like you do, there are endless possibilities. Overall, I am very satisfied with the customized button I now have in my toolbar. Thank-you very much.
Impvgo
Re: Add Send to E-Mail Recipient to Tool Bar
Posted: 19 May 2011 06:10
by serendipity
IMPVGO wrote:I am sure trying to learn scripting, although it is difficult. In any case, this has been a good learning experience. I had been trying to put-up a script with these characteristics for a while, but nothing concrete had come up. I sure will be making positive comments about XYPlorer, as I genuinely think is the best file manager there is, and if you know scripting like you do, there are endless possibilities. Overall, I am very satisfied with the customized button I now have in my toolbar. Thank-you very much.
Impvgo
Glad you like XYplorer. And for scripting, good place to start is :
http://www.xyplorer.com/tour/index.php?page=scripting
Re: Add Send to E-Mail Recipient to Tool Bar
Posted: 04 May 2014 23:41
by sinilill
Started to use Thunderbird and this script came very handy, only the command window seemed a little bit annoying, but there's a solution.
By adding the command 'start' before the executable the command window closes right after carrying out the command.
Example:
Code: Select all
old: run "cmd /c cd /d C:\Program Files\Mozilla Thunderbird\ & thunderbird -compose $TB_Syntax";
new: run "cmd /c cd /d C:\Program Files\Mozilla Thunderbird\ & start thunderbird -compose $TB_Syntax";
works also like this in my portable configuration:
Code: Select all
run "cmd /c start <xypath>\..\Thunderbirdportable\ThunderbirdPortable.exe -compose $TB_Syntax";