Substr in Auto-texts

Hello there!

Today lets talk about how to create a substr in auto-texts.

You just have to:

1. Create a new document;

2. Create an HTML Container;

3. Insert this code:

<script type=”text/javascript”>

function substringFunc(){
var username= document.getElementById(“pText”).innerHTML;
document.getElementById(“pText”).innerHTML = username.substr(1,5);
<p id=”pText”>{&USER}</p>


document.getElementById(“pText”).onload= substringFunc();

4. Change the substr values to get what you need for your string. Here is an explanation of this javascript function:

You can also change the {&USER} to another auto-text.

Run your document in Express or Interactive mode and you will get something like that:



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.