"Lorem ipsum"-izer script to make your documents make less sense

I made some newspaper mock-ups and needed to change the text of existing pages into lorem-ipsum nonsense, while keeping the formatting and amount of text the same. So I made this scripts. It will change any words in the current selection into nonsense.
It's a bit slow because it loops through every single word in the selection and changes it into latin-sounding words with the same number of characters, and then adds or subtracts some letters to make sure the text is pretty much the same number of lines in the end.
I have only tested it with CS3.
for (var n=0; n<app.selection.length; n++){
     loremIpsumize(app.selection[n]);
function loremIpsumize(myText){ // myText could be a TextFrame, Story, InsertionPoint, Word, Text etc...
     var loremIpsumDictionary = [[""], // this is the dictionary of words sorted by number of letters. The words are taken from InDesigns "fill with placeholder text"-feature
                       ["a","e","y"],
                       ["el","si","em","se","an","er","do","re","te","at","os","od","to","et","eu","ud","na","ex","ed","ut","ad","il","in","la","it","is","ip","am","ea"],
                       ["ing","lam","vel","lan","lis","lor","ute","ver","con","lum","lut","ibh","del","unt","min","mod","feu","nim","nis","nit","non","nos","bla","eum","eui","num","aut","dio","odo","wis","tis","tio","pis","pit","qui","ate","tin","tie","ese","tet","tem","dip","rat","ero","ril","rit","ros","dit"],
                       ["duis","alit","dunt","ecte","sisi","elis","elit","enim","enis","enit","sent","wisl","erat","amet","tate","alis","erci","erit","wisi","eros","esed","esse","essi","dion","atem","atet","acil","esto","atio","quis","atue","etue","quip","ting","etum","atum","quat","quam","diat","euip","prat"],
                       ["lorem","ispum","magna","ulput","lutem","minci","minis","lummy","commy","adiat","minit","conse","lorer","lorem","ullum","adiam","lobor","modip","modit","lenit","lenim","laore","cipit","molor","utpat","velis","iusto","iusci","iurem","molum","velit","ullan","ullam","nisci"],
                       ["mconse","magnit","mincip","magnis","magnim","minisi","minisl","lutpat","wissis","wissim","acidui","modiat","commod","luptat","wiscip","wiscin","lumsan","wiscil","molent","cinibh","lortio","vulput","molore","lortin","lortie","vullut","vullan","vullam","ncidui","volute","lorper"],
                       ["feuisci","sustrud","ationse","feuisis","feuisit","feuguer","feuismo","feugiat","feummod","feugiam","hendiam","feugait","dolorem","andreet","suscipi","hendrem","hendrer","facipit","heniamc","amconul","atuerat","facipis","dolorer","facinim","tetummy","facinim","delesto"],
                       ["dolortis","vendreet","vullutat","consequi","niatuero","eugiamet","nismodit","adignibh","eugiatet","zzriusto","doluptat","veliquat","nonsecte","veliquam","velestis","dolortio","nonsenim","velessim","dolortin","dolortie","velenibh","nonsequi","veleniat","conullam","eraessit"],
                       ["iriliquis","blandipis","quismolor","irillamet","consequis","iriuscing","blaorerit","iriustrud","etuerosto","nissectet","vendiamet","volestisl","dionsenim","digniamet","eniatisit","quamcommy","iurerosto","ionsequat","ptatueros","consequat","duiscipit","scillummy","veliquisl"],
                       ["loremipsum","exeriurero","nummodolor","ullamcommy","veriliquat","conulputat","uismodolor","exeraessit","exerostrud","nullaortis","tisiscipis","nullaoreet","nullandrem","odigniamet","nullandiat","verciduisi","erciduisit","faciduisim","lummolessi","facincipit","voloreetum"],
                       ["dolortionum","veliquiscil","euguerostie","veliquamcon","aciliquisim","eummolestin","adionsequat","adipsustrud","vercincinis","dolorpercin","exeraestrud","ullaorperit","wismolobore","amconsequis","essequating","facipsustio","doloreetuer","elesequisim","augiametuer"],
                       ["dolutatueros","adigniamcore","velesequipit","adigniscipis","eummolortion","dolorperiure","dolorpercing","ulputpatetue","uipsuscidunt","aliquipsusci","tumsandionse","tionsequisim","facilismolut","facillametum","atueraestrud","sustionsenim","iliquatiniat","dolenismodit"]];
     var myStory; // the parent Story of myText
     if (myText instanceof Story){
          myStory = myText;
     } else if (myText instanceof InsertionPoint){
          myText = myStory = myText.parentStory;
     } else if (myText.hasOwnProperty("parentStory")){ // myText instanceof Word, TextFrame, Character, TextColumn or Paragraph
          myStory = myText.parentStory;
     } else { // myText is not text, but some other object
          return;
     if  (myText.hasOwnProperty("paragraphs") && !(myText instanceof Paragraph)){ // The script returns better looking results when one Paragraph is processed at a time
          var myParagraphs = myText.paragraphs.everyItem().getElements();
          for (var n=myParagraphs.length-1; n>=0 ; n--){
               loremIpsumize(myParagraphs[n]); // clever recurson
     } else if (myText.contents!=""){
          app.findGrepPreferences = NothingEnum.nothing;
          app.changeGrepPreferences = NothingEnum.nothing;
          app.findGrepPreferences.findWhat = "[\\u\\l'@\u00E6\u00C6]{1,"+loremIpsumDictionary.length+"}"; // only looks for word-characters and leave punctuation, spaces as they are
          var storyLineNumber = myStory.lines.length; // remembers how many lines the story has, and tries to make the new text the same number of lines
          var myWordMatches = myText.findGrep(); // an array of Word references that fit the grep
          for (var i=myWordMatches.length-1; i>=0; i--){
               myWordMatches[i].contents = loremipsumWord(myWordMatches[i].contents); // changes the word into a random latin-sounding one
          fineTuneText(storyLineNumber);
     function fineTuneText(targetNumberOfLines){ // tries to make the text the correct number of lines by adding or subtracting one letter at a time
          var myNumberOfCharacters;
          var newWord;
          var myWord;
          while (targetNumberOfLines != myStory.lines.length) {
               myNumberOfCharacters = myText.characters.length;
               for (var changeWord = myWordMatches.length-1; changeWord>=0; changeWord--){          
                    myWord = myWordMatches[changeWord];
                    if (targetNumberOfLines>myStory.lines.length){
                         newWord = loremipsumWord(myWord.contents+"a"); // adds a letter
                    }else if (targetNumberOfLines<myStory.lines.length){
                         newWord = myWord.contents.length>1? loremipsumWord(myWord.contents.slice(0,-1)): myWord.contents; // removes a letter                    
                    } else {
                         return true; // targetNumberOfLines == myStory.lines.length
                    myWord.contents = newWord;
               if (myNumberOfCharacters == myText.characters.length){
                    return false; // Every word in the text has been reduced to a single character, and the text is still too long.... Give up.
               } else {
                    myWordMatches = myText.findGrep(); // Need to do a new search, since the text has been changed
     function loremipsumWord(myWord){ // takes a string and returns a random word with same number of letters, and the same capitalization
          var replacementWord = "";
          var correctCaseWord= "";
          var wordLength = myWord.length;
               if (wordLength >= loremIpsumDictionary.length){ // in case myWord is longer than the longest words in the dictionary
                    replacementWord = loremipsumWord(myWord.substr(0,loremIpsumDictionary.length-1))+loremipsumWord(myWord.substr(loremIpsumDictionary.length-1)); // The word is longer than the longest words in the dictionary. So it's split in two.
               } else {               
               replacementWord = loremIpsumDictionary[wordLength][Math.floor(Math.random()*loremIpsumDictionary[wordLength].length)]; // finds a random word of the same length
               if (myWord.toLowerCase()!=myWord){ // the word contains uppercase characters
                    correctCaseWord = "";
                    for (var n=0; n<wordLength; n++){ // loops through each character in the original word, checking if it's upper or lower case.
                         correctCaseWord += myWord.charAt(n).toUpperCase()==myWord.charAt(n)? replacementWord.charAt(n).toUpperCase(): replacementWord.charAt(n); // makes the character the correct case
                    replacementWord = correctCaseWord;
          return replacementWord;

Thank you Haakenlid, exactly what I needed now.

Similar Messages

  • When I click the Sections button then click on the 1st page I get  a page that is titled "Lorem ipsum dolor sit amet"! Where did it come from and how do I get rid of it. I have tried deleting and "dont save" but it comes back.

    In Pages when I click the 'Sections'  button then click on the 1st page I get  a page that is titled "Lorem ipsum dolor sit amet"!  Where did it come from and how do I get rid of it? I have tried deleting and "dont save" but it comes back. It is a full page in some unknown language. The only thing I can decifer is 'cupy uf cak'.   Rdal

    Roger,
    The icon is +Sections, not just Sections, as in "Add a Section". When you click that icon you get a section break and and a new section template, complete with preformatted text called placeholder text. The reason "Lorem ipsum" is there is so you can see what the format looks like. The reason that it is Latin gibberish is so you won't get hung up on, or distracted by, what it says. It's just a display of format. Select the "Lorem ipsum" text and start typing your content.
    Jerry

  • Lorem ipsum feature

    I read about the new lorem ipsum text generator, it's really a nice and helpful feature.
    I saw on the youtube that it is found at Type -> "Paste Lorem ipsum"
    but I found it Type -> "Lorem ipsum" only and I tried it many times but it didn't work
    I'm using windows vista

    I tried it by opening a New transparent layer and selecting the tool Text icon to make a text layer. Then opened a box to add type into the layer and then the lorem ipsum selection in Type Menu will allow you to paste the paragraph or what ever it is into your layer text box...You can then highlight the text and view it in what ever font, color or attribute you want..The paragraph is in Latin maybe?. I used wide Latin font here. Have fun with it... Hope my instructions were not too confusing.
    MikeT.

  • How do you get your Document folder next to your Applications on the dock?

    I was deleting a file from my screen, and I accidentally removed my Document Folder so it is off my dock. Now next to the dashed lines to make the dock bigger, I only have my Application folder with the trashcan. I have no idea how my Document folder back on! Please help!

    Go into finder, under "Places" click your user account, then click on "Documents" and drag it down next to Applications. The Applications folder and Trash Can should move over to make room for your Documents folder

  • Heads up the Lorem ipsum stays in the book

    I used a few photo gallery widgets in my book.  But I didn't write descriptions of each picture.  Just the first one in the gallery.  Each picture you drag into the box shows up with the default Lorem ipsum text.  I figured iBooks Author would know I didn't want that in the final version of my book, and didn't bother to delete it.  Now I'm getting emails from people wondering why some of the descriptions are in a different language.
    I'm not sure if there is a way to edit, and make changes once the book is in the store.  Need to look into it I guess.  Just wanted to post a warning in case someone else might make the same mistake.

    Hallo,
    yes, I also think that it is very annoying that this lorem ipsum text has to be deleted manually!
    In the case of the gallery widget you can prevent this line for each photo if you select "same subtitle for all picures" in the inspector, widget, layout tab.

  • Webhelp vulnerable during XSS cross site scripting audit. Reason - document.location.href

    Online help created by team is going through a security vulnerability check now. It has been found that after integration of webhelp with the application,document.location.href  is a vulnerable point as per XSS cross site scripting. Please your thoughts and any methods you have that can contain this situation. Its urgent, please help.

    This thread is now locked. See the duplicate post.
    See www.grainge.org for RoboHelp and Authoring tips
    @petergrainge

  • One script to make multiple cells call one function or vice versa

    Please help.
    I need one script to make multiple cells reference one function or one cell reference multiple functions.
    Goal: On the enter event of cell c1, I want to make cells (this, Header.c1, Example.c1, rLabel) highlighted, and this would be for every other cell that is entered into, their corresponding column header and row header will be highlighted.
    I've tried combining cells: eg
    colourControls.hdfieldLoseFocus(this, HeaderRow.c1, Example.c1, rLabel);
    and I've also tried combining some scripts in the function:
    fieldObj.ui.oneOfChild.border.fill.color.value = "255,255,200";
      HeaderRow.fieldObj.ui.oneOfChild.border.fill.color.value = "255,255,200";
      ExampleRow.fieldObj.ui.oneOfChild.border.fill.color.value = "255,255,200";
    But they dont work. See the link to my form.
    http://www.winstonanddavid.com/example.com
    I tried testing the function with the cell 'c1' but it doesnt work.
    Also, I want to get rid of the multiple lines of script in every other cell.
    How can I do this?

    I played around with the ExtendScript Toolkit and cutted and pasted the previous script from here until I managed to get a script that actually works like I was thinking. I then added a code from the CS4 Reference Manual to move Layer1 to the top (just to see if it worked).
    I have no idea yet if the the code includes something that does not belong, but at least I get no errors. The current code is like this now:
    //Apply to myDoc the active document
    var layerName = LayerOrderType;
    var myDoc = app.activeDocument;
    //define first character and how many layers do you need
    var layerName
    var numberOfLayers=0;
    //Create the layers
    for(var i=0; i<=numberOfLayers; i++)
    { var layerName = "Background";  var myLayer = myDoc.layers.add(); myLayer.name = layerName;  }
    { var layerName = "Picture";  var myLayer = myDoc.layers.add(); myLayer.name = layerName;  }
    { var layerName = "Text";  var myLayer = myDoc.layers.add(); myLayer.name = layerName;  }
    { var layerName = "Guides";  var myLayer = myDoc.layers.add(); myLayer.name = layerName;  }
    // Moves the bottom layer to become the topmost layer
    if (documents.length > 0) {
    countOfLayers = activeDocument.layers.length;
    if (countOfLayers > 1) {
    bottomLayer = activeDocument.layers[countOfLayers-1];
    bottomLayer.zOrder(ZOrderMethod.BRINGTOFRONT);
    else {
    alert("The active document only has only 1 layer")

  • Flash Pro CC saved fla project - "Could not load scene into memory. Your document may be damaged."

    Hi all, I've been working on a project in Flash Professional CC in windows 7 that was started in a previous version of Flash Pro and occasionally after I've saved the project and tried to open it the next day I get the "Could not load scene into memory. Your document may be damaged." message and only a blank Scene 2 in the project. I've previously been reverting back to the old saved project file and starting over. Its wasted a lot of time so far.
    I can still open the same exact project in CS6 on another older computer but not in CC. I can also save the fla in CS6, transfer it to the other computer and then it will work again (for now). This isn't going to be an option in the future as CS6 was a trial version that is on its last use today.
    I've tried to create a new flash pro cc project and just copied and pasted the library and scene layout from the old project into the new project. This worked for a couple of saves/ opens but the error has happened again.  I'm scared that now that I've reached the point in the project were my work in the animation/ visual side will start to be more intensive that I will continuosly have to worry about losing all of my work. I'm using a document class so the AS3 code hasn't been an issue thankfully. Any help would be appreciated.

    Thanks for the reply Amy, that is essentially what I am doing already only I'm not using version control software I'm just managing it on my own since its a solo project, though I have been considerring using git anyway. It still doesn't explain why I can open and save the supposedly damaged project (according to CC) in CS6 and only then will it work again in CC. Also I'm not gettting a chance to save as a new version over and over for long. Its only a couple of days max, usually just over one day, and I've primarily been working on the code in Flash Builder with little functional change in the actual fla project. Its primarily changing movieclips instance names, which in this project is tedious and time consuming. Having to revert back to the older working version is exaclty what I'm trying to avoid. I shouldn't have to commit the project to a repository every little change that I make to the fla file.

  • Is there a script to make automatic footnotes?

    Yeasterday my boss gave me a book to lay out.
    I must do alphabetic index and over 1200 footnotes. If I imagine this proccess, it makes me sad
    The first part of this job isn't hard, because I plan to use two brilliant scripts to make index: IndexBrutal and IndexMatic.
    You can download  them from this website http://marcautret.free.fr
    But I need and plead for your help with footnotes. Is there a script to make automatic footnotes?
    Or, maybe, you know the faster way to do this boring repeating of mouse cliks?????
    Thanks a lot.

    Depends on what you mean by "make" footnotes. What are you making them from? I used a script from http://www.adobescripts.com/modules/mydownloads/viewcat.php?cid=9 once to convert thousands of endnotes back to into footnotes. And I'm sure there's a similar way to automate the process (either through scripting or a find/replace) if your footnotes are embedded in text but marked some way. For instance, if your footnotes look like this at the moment:
    text more text footnote number comes next (22) text of footnote here end of footnote comes next\ more text following footnote
    In this case, all footnote numbers show up between parentheses and all footnotes end with a backslash. If your footnotes are marked beginning and end in some similar fashion, then there's hope.
    Ken Benson

  • Need a script to make the browser fly over the screen, bouncing around

    I have heard about the youareanidiot.org virus. I need a script to make the browser fly over the screen, bouncing around. Do you have one?

    This is a professional forum, we do not help with jokes that will cost you your job.
    Don't retire TechNet! -
    (Don't give up yet - 13,225+ strong and growing)

  • PowerShell script to list ALL documents bigger than 10MB - in list attachments/libraries all over my site?

    Hi there,
    Just wondering if someone can give me the PowerShell script to list ALL documents bigger than 10MB - in list attachments/libraries all over my site?
    Really appreciated.
    Thank you.

    Hello,
    here you can find sample to help you create yoru script :
    http://sharepointpromag.com/sharepoint/windows-powershell-scripts-sharepoint-info-files-pagesweb-parts
    see this sample extract from this site
    Get-SPWeb http://sharepoint/sites/training |
                                     Select -ExpandProperty Lists |
                                     Where { $_.GetType().Name -eq "SPDocumentLibrary" -and
                                             -not $_.Hidden }
    |
                                     Select -ExpandProperty Items |
                                     Where { $_.File.Length -gt 5000 } |
                                     Select Name, {$_.File.Length},
                                            @{Name="URL";
                                            Expression={$_.ParentList.ParentWeb.Url
    + "/" + $_.Url}}
    this can help too :
    https://gallery.technet.microsoft.com/office/Get-detail-report-of-all-b29ea8e2
    Best regards, Christopher.
    Blog |
    Mail
    Please remember to click "Mark As Answer" if a post solves your problem or
    "Vote As Helpful" if it was useful.
    Why mark as answer?

  • Add placeholder text / Lorem ipsum

    Does anyone know how to add placeholder text in Illustrator? I know it can be done in ID, but I haven't been able to find it in Illustrator. I know I could copy & paste, but I'd like to see if there's a better route. I checked scripting forums as well, but was unable to find anything. Thanks!

    I have a big snippet of placeholder text in TextExpander.
    When I want a load of Lorem Ipsum, I just type
    lorips and the following text pops into place in front of the flashing text cursor, in any app:
    Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nullam ornare dictum ligula. Maecenas elementum suscipit nisl. Cras imperdiet leo ac felis dictum luctus. Pellentesque odio nisi, accumsan nec, scelerisque sed, consectetuer nec, justo. Sed tortor sapien, suscipit id, pulvinar vel, elementum id, lorem. Nullam consectetuer risus sit amet nibh. Vestibulum consectetuer, quam vitae euismod volutpat, magna magna consectetuer dui, et accumsan magna dui non nibh. Morbi adipiscing consequat erat. Vivamus quis massa eget orci fermentum laoreet. Morbi posuere purus. Duis feugiat lacus vel nisi. Aliquam ipsum felis, pretium sed, vehicula vel, dictum eget, nibh. Morbi turpis nulla, luctus viverra, pretium in, suscipit vitae, purus.
    Morbi gravida lacus sed lorem. Mauris vestibulum. Cras vehicula porta eros. Curabitur ut justo vel pede elementum semper. Integer pretium pulvinar augue. Aenean ut nisl non lectus porta feugiat. Mauris iaculis pede a risus. Suspendisse mollis. Donec suscipit. Sed tellus magna, tempus a, ultricies in, dignissim et, nulla. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Suspendisse potenti. Proin viverra vulputate pede. Sed nec mauris ut turpis convallis tempus. Maecenas id justo vitae lacus fringilla interdum. Nulla diam.
    Phasellus interdum dictum tellus. Donec convallis leo in orci. Vestibulum eget nibh. Nullam consectetuer blandit elit. Cras non ipsum ut nulla pulvinar consequat. Maecenas tincidunt, dui sed interdum vehicula, justo arcu tempus risus, id semper arcu velit sit amet mi. Donec sem. Sed pulvinar fringilla elit. Quisque ante. Cras tempor lobortis velit. Phasellus porta arcu sit amet libero. Aenean aliquet, leo in porta aliquam, est tortor accumsan justo, vel ultrices leo dui nec velit. Etiam vel nibh. Quisque eu ante ut diam auctor molestie. Nullam mattis, nulla et molestie cursus, neque orci consectetuer nisl, eget consequat sapien pede vitae augue. Fusce pretium velit et lacus. Cras commodo sagittis velit. Proin lobortis, diam in semper viverra, enim pede adipiscing massa, a convallis enim sem consectetuer odio.

  • Remove Lorem Ipsum add-on

    Keep geting "Uinstalling The Add-on Lorem Ipsum Generator failed Generator failed to remove
    I don't want it installed, since it for an old version of Photoshop and i only have the latest version installed (Photoshop 2014 CC).
    Tried to install it and uninstall it from https://creative.adobe.com/addons.  To make the message go away !
    The Add-on is not showing up in Adobe Extension Manager CC either.
    Is there any way to remove this message ?

    Contact Sheet is a welcome return. So many features can be adapted. I made this a few years ago by sizing up 40 images, and turning off titles, and ‘Flatten Layers’ when making the contact sheet. It was then fairly simple to FT each layer to give some overlap, and use Layer masks for creative affect.
    It was eventually incorperated into a poster for the organisation running the event.
    Some interesting JDIs  (thanks so much for the typed list!).
    The Eye dropper changes appeal to me, and Ctrl J now working on Groups is very welcome.  Lots more there, but what worries me is that there are apparently twice as many new JDIs in CS6 as there were in CS5, which makes me think I must be missing a lot of the CS5 JDIs.  is there a list somewhere?

  • How do i get lorem ipsum for dreamweaver cs5.5?

    How do i get lorem ipsum for Dreamweaver cs 5.5?

    Go to http://generator.lorem-ipsum.info/
    and copy a few paragraphs of lorem-ipsum text.to you clipboard,
    In DW, open your Snipppets panel and create a new snippet and paste your text in it and save it..

  • Is there a setting to automatically close the "please wait while we generate your document" page that pops up when downloading a pdf file?

    I am constantly downloading pdf's and excel files from our company software which uses a web browser to access it. When I download a file, firefox generates a full screen pop up window that states "please wait while we generate your document." My problem with it is the fact that pop up window does not close after the download. I have to manually close the window. Is there a way to set that pop up window to close automatically after the file has finished downloading and is open in foxit reader or excel or word or whatever?
    Thanks,
    Tony

    Hi,
    You could try is to '''Disable''' the Foxit, Adobe and Office '''Plugins''' in '''Tools '''('''Alt '''+ '''T''') > '''Add-ons''' and use the normal Firefox Open with (when you click on a link) to browse/open it in the required application.
    [https://support.mozilla.org/en-US/kb/Using%20plugins%20with%20Firefox Using plugins]

Maybe you are looking for

  • CTSS is not working properly in RAC 11.2.0.1 on vmware 1 (redhat 5.3)

    Dears I have installed CRS 11.2.0.1 on vmware 1 at redhat 5.3 . CRS has installed sucessfully without any error. but when execute [oracle@RAC1 grid]$ ./runcluvfy.sh stage -post crsinst -n RAC1,RAC2 -verbose Checking if Clusterware is installed on all

  • Acrobat Pro 8.1.3 always opens in browser

    As a result of Adobe recently automatically updating my Acrobat 8 Pro to version 8.1.3 it now always opens clicked PDF links in IE7 browser window, even though EDIT/PREFERENCES/INTERNET "Display PDF in browser" is UNTICKED in both Acrobat Pro and Acr

  • Idocs for CFM + CML

    Hi all, I'm looking for the proper Idocs for creating/changing CFM & CML transactions from an external source. Can you please point me to a list which will elaborate on which one to use and how to use it? Also, can someone tell me what are the major

  • I lost my files

    I have update my OS to 10.7.3 last Wed. and on Thurs I wake my computer from sleep. It have VMWare running. Suddenly VMWare report not enough space and ask me to clear more space. (I am on Macbook Air 13" w 128GB SSD) I choose continue instead but it

  • Program operation error finger print reader

    HP Paviliom m6 brand new. Window 7 Home Premium 64 bit. Have contacted Software company and tried everything the said to do.  Simple Pass is uninstalled and still keep getting the same error message.