is now part of CreativePro.com!

Scramble Text in Place to Hide Private Info

8

Bruce asked:

Is there any way to scramble or replace existing text with placeholder text? I have possibly sensitive documents I want to show for portfolio on my site to show design, but if I could scramble the text, I wouldn’t be divulging sensitive client info.

That’s a really interesting idea! I don’t know of any script or plug-in to do this for you, but it occurs to me that you could use InDesign’s built-in FindChangeByList script to scramble (or encipher, or mix up, or whatever you want to call it) your text. All you’d need to do is make a custom FindChangeList.txt file.

You see, the FindChangeByList.jsx script reads a sequence of find/change replacements that you define in the text file. If you have 20 different find/change queries you want to do in order, this script is great for that. (The main problem is that you need to take the time to “code” that text file. If you want an easier way to do a whole sequence of find/changes, check out the reasonably-priced MultiFindChange product.)

Anyway, I opened the FindChangeByList.txt file, edited it to scramble up the letters, saved it (with a new name), and ran it on a document. Here’s what the file looked like before:

Scramble1

and here’s how it looked after I ran FindChangeByList:

Scramble2

It’s not perfect, and it certainly could be easily cracked by a cryptologist, but it would do for a lot of simple work.

You can download my FindChangeList_Scramble file here. To install it, right-click the FindChangeByList script in the Scripts panel. (It’s inside Application/Samples/Javascripts.) Then open the FindChangeSupport folder and place this text file in it. Now change the name of the FindChangeList.txt file (even just a little bit). That forces the FindChangeByList.jsx script to ask you which findchangelist file you want it to use.

If you have suggestions for how to make this scramble file better, feel free to post them or email them to me and I’ll update the file.

David Blatner is the co-founder of the Creative Publishing Network, InDesign Magazine, CreativePro Magazine, and the author or co-author of 15 books, including Real World InDesign. His InDesign videos at LinkedIn Learning (Lynda.com) are among the most watched InDesign training in the world.
You can find more about David at 63p.com

Follow on LinkedIn here
  • I love it, what a clever use for that Find/Change script!

    But I’ve been using the LoremIpsum-izer script for the past few years. I found it here where someone wrote it out:
    https://forums.adobe.com/thread/765245

    It works great with CC 2014 and earlier. You can download the .jsx file here: https://creativepro.com/downloads/LoremIpsum-izer.jsx

  • Eugene Tyson says:

    Here’s one that jongware wrote for me a few years ago. https://pastebin.com/index/qgwauZPR

  • Sandee Cohen says:

    Several thoughts:

    Use this online versions of the Enigma machine. https://users.telenet.be/d.rijmenants/en/enigmasim.htm. https://enigma.louisedade.co.uk/. https://startpad.googlecode.com/hg/labs/js/enigma/enigma-sim.html

    Use a font editor such as Type Tool and make copies of the fonts used. For instance, if you’ve used Myriad Pro, make a copy called Myriad Pro Srambled. Then swap the glyphs in the positions of the fonts. T would be where x is. E would be where a is. M would be where b is. This will take a LOT of work. Then apply the copies of the fonts to your text. The benefit of this approach is that the actual Unicode numbers of the glyphs are maintained. So when you change the font back to the original, you still have the text. Even better, you can type or import ordinary text into the layout and it will be scrambled.

  • Mike Rankin says:

    One of the cool things about the LoremIpsum-izer script is that you can open it and change the words it uses. So with a little cut and paste work you’d have a script that replaces your existing text with bacon ipsum, Star Wars ipsum, or whatever ipsum you create on your own. You could easily make a hybrid corporate-zombie-cupcake ipsum, Or an ipsum made out of your nana’s catchphrases. The possibilities are endless.

  • David Cardillo says:

    what about a simple rot13?

    It “rotates” (rot) the characters 13 places in the alphabet. (e.g. A > N, B > O, M > A)

    The nice thing is, since the English alphabet is 26 letters, if you run it a second time, it puts them all back where it was.

    Here’s the text of the applescript I use:

    tell application “Adobe InDesign CC 2014”
    if (count of every document) > 0 then
    set theAlphabet to “abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ”
    set theROT to “nopqrstuvwxyzabcdefghijklmNOPQRSTUVWXYZABCDEFGHIJKLM”
    set ReplaceThis to the selection
    set ReplacementText to ReplaceThis as string
    set WithThis to “”
    if ReplacementText is not “” then
    considering case
    repeat with eachChar in ReplacementText
    set x to the offset of eachChar in theAlphabet
    if x is not 0 then
    set WithThis to ¬
    WithThis & (character x of theROT) as string
    else
    set WithThis to (WithThis & eachChar) as string
    end if

    end repeat
    end considering
    set ReplaceThis to item 1 of ReplaceThis
    set the contents of ReplaceThis to WithThis –as string
    else
    display dialog “select some text first”
    end if
    else
    display dialog “you need to select text in an open document”
    end if
    end tell

    I’ve put in online here:
    https://randomhouse.box.com/s/0inrfdeis8qrw92i8kjb

  • Thank you David for the script! Pretty cool.

  • Stephane Bourrelle says:

    Here is an variation on David code, for the Rot13 script. My variation add the option to “UnRot13”.
    The script open with a two option dialogue button. It just make the script a little more handy.

    (* This is a Rot13 script originally posted by David Cardillo,
    on indesignsecrets.com (David Blatner).
    I have added the option to “UnRot13” (reverse the action).
    All the credits go to David for originally posting this cool script.
    Stephane Bourrelle. 2018-02-28 *)

    tell application “Adobe InDesign CS6”

    set MyChoice to display dialog “What do you ” & return & “want to do” buttons {“Rot13”, “UnRot13”}
    if button returned of MyChoice is equal to “Rot13” then

    if (count of every document) > 0 then
    set theAlphabet to “abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ”
    set theROT to “nopqrstuvwxyzabcdefghijklmNOPQRSTUVWXYZABCDEFGHIJKLM”
    set ReplaceThis to the selection
    set ReplacementText to ReplaceThis as string
    set WithThis to “”
    if ReplacementText is not “” then
    considering case
    repeat with eachChar in ReplacementText
    set x to the offset of eachChar in theAlphabet
    if x is not 0 then
    set WithThis to ¬
    WithThis & (character x of theROT) as string
    else
    set WithThis to (WithThis & eachChar) as string
    end if
    end repeat
    end considering
    set ReplaceThis to item 1 of ReplaceThis
    set the contents of ReplaceThis to WithThis as string
    else
    display dialog “select some text first”
    end if
    else
    display dialog “you need to select text in an open document”
    end if

    else if button returned of MyChoice is equal to “UnRot13” then

    if (count of every document) > 0 then
    set theAlphabet to “nopqrstuvwxyzabcdefghijklmNOPQRSTUVWXYZABCDEFGHIJKLM”
    set theROT to “abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ”
    set ReplaceThis to the selection
    set ReplacementText to ReplaceThis as string
    set WithThis to “”
    if ReplacementText is not “” then
    considering case
    repeat with eachChar in ReplacementText
    set x to the offset of eachChar in theAlphabet
    if x is not 0 then
    set WithThis to ¬
    WithThis & (character x of theROT) as string
    else
    set WithThis to (WithThis & eachChar) as string
    end if
    end repeat
    end considering
    set ReplaceThis to item 1 of ReplaceThis
    set the contents of ReplaceThis to WithThis as string
    else
    display dialog “select some text first”
    end if
    else
    display dialog “you need to select text in an open document”
    end if
    end if
    end tell

  • >