Announcement

Collapse
No announcement yet.

FAQ: What kind of scripts can I use in DirectSmile Sets?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • FAQ: What kind of scripts can I use in DirectSmile Sets?

    More helpful information about scripts, thanks again to Wolfgang!

    Using a script in a DirectSmile Set creates a lot of possibilites!

    Please see: Frequently used scripts

    We also created one sample DirectSmile Set for each script of the "Frequently used scripts":
    Click here to download all example dSet files


    Examples

    1) put out the initials of the incoming text automatically

    Click image for larger version  Name:	ScriptSet1.jpg Views:	1 Size:	36.3 KB ID:	941


    2) Show the first line behind the second line

    Click image for larger version  Name:	ScriptSet2.jpg Views:	1 Size:	105.3 KB ID:	942


    3) Create different designed frames that can be addressed with the frame number
    e.g. incoming text "2\#Smile" would use frame 2 only

    Click image for larger version  Name:	ScriptSet3.jpg Views:	1 Size:	215.8 KB ID:	943


    4) Change incoming text into the Proper Case
    e.g. DIRECT smile ----> Direct Smile

    Click image for larger version  Name:	ScriptSet4.jpg Views:	1 Size:	12.4 KB ID:	944

    5) Fill up a given amount of single letter frames with defaults in a different colour

    Click image for larger version  Name:	ScriptSet5.jpg Views:	1 Size:	65.9 KB ID:	945
    Last edited by DSM; 12th July 2017, 15:28.

  • #2
    6) Script: devide the text in three textframes

    You can download an example Set here
    or simply copy and paste the following script in your set (required are three frames):


    function txtOut()
    ' base parameter
    maxLines = 3
    normLineChar = 20

    ' get the incoming text
    txt = Trim(RS("IncomingText"))

    ' check and correct if the normal count of characters per line is smaller than needed
    If Len(txt) > maxLines * normLineChar Then normLineChar = (Len(txt) \ 3) + 1

    ' check and correct if the normal count of characters per line is smaller than the largest word
    word = Split(txt, " ")
    For i = 0 To UBound(word)
    wl = Len(word(i))
    If wl > normLineChar Then normLineChar = wl
    If wl > count Then count = wl
    Next
    normLineChar = normLineChar + (count\3)

    ' deliver text to lines
    Do While Len(txt) > normLineChar
    t = Left(txt, normLineChar)
    t = Left(t, InStrRev(t, " ") - 1)
    txt = Mid(txt, Len(t) + 2)
    tmp = tmp & "\#" & t
    Loop

    ' to begin always at first line change the order of the following two lines
    If Left(tmp, 2) = "\#" Then tmp = Mid(tmp, 3)
    tmp = tmp & "\#" & txt & "\#"

    ' set return value
    txtOut = tmp
    End function

    Comment


    • #3
      We have been using the following script to ensure all text is lower case apart from the first char of each word:

      function txtOut()
      txt = Trim(RS("IncomingText"))
      wrd = Split(Replace(txt, "-", " "), " ")
      For i = 0 To UBound(wrd)
      txtOut = txtOut & UCase(Left(wrd(i),1)) & LCase(Mid(wrd(i),2))
      txtOut = txtOut & Mid(txt, Len(txtOut) + 1, 1)
      Next
      End function

      However when I pass personalisation over multiple layers/text frames using '\#' the rule fails.

      e.g.: EDGAR\#RICE\#BURROUGHS

      One way can be to replace the two sings of the "\#" with a single sign, then replace this sign also into a space to fit in the given rule. When the rule is finished revert the single replacement sign back into the "\#".

      function txtOut()
      txt = replace(Trim(RS("IncomingText")),"\#","¥")
      wrd = Split(Replace(Replace(txt, "-", " "), "¥", " "), " ")
      For i = 0 To UBound(wrd)
      txtOut = txtOut & UCase(Left(wrd(i),1)) & LCase(Mid(wrd(i),2))
      txtOut = txtOut & Mid(txt, Len(txtOut) + 1, 1)
      Next
      txtOut = Replace(txtOut, "¥", "\#")
      End function


      Click image for larger version

Name:	ScriptSet6.jpg
Views:	26
Size:	40.3 KB
ID:	948

      Comment

      Working...
      X