[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4688: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4690: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4691: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4692: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
Poco Forums • View topic - New script to add multiline phrases or signatures

New script to add multiline phrases or signatures

Scripting questions and ideas

Moderators: Eric, Tomas, robin, Michael

New script to add multiline phrases or signatures

Postby Sapiem » Mon Jul 31, 2006 8:38 am

Saludos:

Intento compartir este script que he diseñado para quitar el problema de tener que hacer más de un archivo de texto al intentar hacer uso por ejemplo de frases multilíneas al final de nuestros correos.

Poco permite llamar un archivo pero no reconoce sus saltos de líneas. Para poder poner una frase de más de una línea, recomiendan usar más de un archivo (en este forum lo explican). Sin embargo, con el siguiente script, no hay necesidad de esto, solo hay que definir una palabra clave (en este caso usaremos $$$MiSaltoDeLinea$$$) la cual reemplazaremos mediante el código al ser enviado el mensaje, por lo tanto, este script debe incluirse en los filtros Outgoing (Pre-Sent).

Es válido tanto para Mensajes Planos como con Estilo.

Por ejemplo, creamos un archivo llamado frases.txt con las siguientes 2 líneas:


"La verdad es totalmente interior. No hay que buscarla fuera de nosotros ni querer realizarla luchando con violencia con enemigos exteriores"$$$MiSaltoDeLinea$$$Mahatma Gandhi
"La violencia es el miedo a los ideales de los demás"$$$MiSaltoDeLinea$$$Mahatma Gandhi




Luego podemos tanto en Templates o Signatures agregar:

%random%:"frases.txt"



(frases.txt asumimos que está en el mismo directorio que Poco.exe)


Esto mostrará en cada nuevo mensaje al final una de las líneas del archivo frases.txt

Se podrá observar que no hay cambios, es decir, mientras estemos escribiendo el texto, veremos que todavía se muestra la palabra clave $$$MiSaltoDeLinea$$$, es porque precísamente será al ser enviado el mensaje cuando haremos la sustitución, por lo que una vez enviado, ya en nuestra carpeta Sent aparecerá totalmente como deseamos.


Script (yo lo he llamado "Reemplazar Frases.poc")--------------------------

ReadRawBody $a %message
StringPos #posi1 "$$$MiSaltoDeLinea$$$" $a
if #posi1 = 0 then Sale
Set $b " "
AppendBody $b " "
ReadHeader $Estilo "Content-Type:" %message
if "text/html" = $Estilo then Rico
AppendBody $b " "
GoTo Sigue
:Rico
AppendBody $b "<br>"
:Sigue
InsertString $a #posi1 $b
SubStrings $a "$$$MiSaltoDeLinea$$$"
AssignBody %message $a
:Sale


Fin Script ------------------------------


No olviden agregarlo como 1ro en la lista de filtros Outgoing (Pre-Sent)

Espero que les resuelva este script, yo lo disfruto mucho..

Les agradecería que me dieran su opinión, como nuevos problemas para tratar de solucionarlos. Trataremos de compartir todo lo que tengamos.

Sapiem :wink:

~ Removed email address to prevent harvesting.
Instead use the PM feature ... Eric ~
Sapiem
Drop-in Visitor
 
Posts: 13
Joined: Mon May 29, 2006 10:01 am

Postby Eric » Mon Jul 31, 2006 9:11 am

Sapiem,

Thanks for posting this, but could you post it in English?
I don't understand much of it and unless someone who understands Spanish, I guess you won't get many replies too. :?

Moved your post from PocoMail to here. :wink:
Eric
 

Postby Second Shadow » Sat Aug 05, 2006 3:52 pm

Super translator to the rescue ... :D

Here's the translation of Sapiem's post:

Hi:

I want to share this script that I wrote in order to be able to add multi-line text files at the end of our messages.

Poco can call a text file but it doesn't recognize its line jumps. In order to be able to add a multiline phrase, we should use more than one file, as recommended in this forum. However, with this script there’s no need for that. You just have to define a key word (in this case we will use $$$MiSaltoDeLinea$$$) which will be later replaced when the message is sent. Therefore, this script should be placed in Outgoing (Pre-sent) filters.

(Note of the t.: $$$MiSaltoDeLinea$$$ = $$$Mylinejump$$$)

This works for both plain and styled messages.

For example, let’s create a file named frases.txt with the following two lines:

"La verdad es totalmente interior. No hay que buscarla fuera de nosotros ni querer realizarla luchando con violencia con enemigos exteriores"$$$MiSaltoDeLinea$$$Mahatma Gandhi
"La violencia es el miedo a los ideales de los demás"$$$MiSaltoDeLinea$$$Mahatma Gandhi

(Note of the t.: just two phrases from Ghandi, you don’t want them translated, now, do you? :) )


Then, we can add either in Templates or in Signatures:

%random%:"frases.txt"

(assuming that frases.txt is in the same directory as poco.exe)


This will show one of the phrases in the frases.txt file at the end of every new message.

You will notice no changes, that is to say, while we are writing the text, we will see that the key word $$$MiSaltoDeLinea$$$ is still shown. That’s precisely because the substitution will be made when the message is sent. After it’s sent, we will be able to see it in our Sent folder exactly how we want it.


Script (I’ve called it “Replace phrases.pocâ€Â
Second Shadow
Poco Tourist
 
Posts: 17
Joined: Thu Mar 17, 2005 2:45 pm
Location: Buenos Aires, Argentina

About translation

Postby Sapiem » Sun Aug 06, 2006 2:45 am

Thanks Erick, I just put in english, but too late :lol:

Thanks

(I have news script, but I'm translating to english)
Sapiem
Drop-in Visitor
 
Posts: 13
Joined: Mon May 29, 2006 10:01 am

Re: About translation

Postby Eric » Sun Aug 06, 2006 8:56 pm

Sapiem wrote:Thanks Erick, I just put in english, but too
You're welcome Sapiem & thanks for the scripts. :wink:
Eric
 


Return to PocoScript Help and How-To

Who is online

Users browsing this forum: No registered users and 1 guest

cron