Back

If your email is not recognized and you believe it should be, please contact us.

  • You must be logged in to reply to this topic.Login

Sorting within paragraph Delimited with Comma

Return to Member Forum

  • Author
    Posts
    • #75897
      Masood Ahmad
      Participant

      I know there is a script to sort Paragraphs and Tables, but can someone suggest me a script that can sort text within a single paragraph delimited with a comma or some other character, for example:

      Bananas, Oranges, Apples, Mangoes, Kiwis, Tomatoes, Avocados
      240, 180, 182, 183, 185, 230, 233, 229, 218, 221, 222, 225 ,186, 213, 385, 387, 216, 217

      This is a single paragraph with words separated by commas. Also note that the paragraph could be numeric, text or alpha-numeric.

      Any ideas.

    • #75917
      Masood Ahmad
      Participant

      Jongware, can you help me on this.

    • #76022
      Oleh Melnyk
      Member
      • #76036
        David Blatner
        Keymaster

        Oleh, also, I would recommend saving as jsx instead of a binary, so that a) people can learn from your script; b) people can edit it if necessary in the future; c) people can read it to confirm that it is not doing anything bad or unexpected to their system.

      • #76043
        Oleh Melnyk
        Member

        David, as far as I know, BlatnerTools is not opensource, as well as Ajar scripts and many others… my scripts doesn’t do anything bad, but sometimes I’m just too lazy to make code readable and understandable

        this script is nothing special o hide, but let it be as it, at least for now

        ————
        updated script https://goo.gl/Hk3MEA

      • #76050
        David Blatner
        Keymaster

        Oleh, you are certainly correct. The only difference is that those plug-ins and scripts are from a web site, where there is technical support if something goes wrong. It is a small difference, but that matters to some people.

        But I appreciate you are helping the InDesign community with these scripts, so thank you!

    • #76035
      Masood Ahmad
      Participant

      Thanks Oleh. It works great. Just one greediness, Is is possible to prompt a user for the delimiter. For example in the above example it was a comma, whereas it might be possible that the words are separated by semicolon or slash etc.

      Something like a message box asking user to input a character(delimiter) and then sorting the selected text separated by the same delimiter.

    • #14324300
      Anonymous
      Inactive

      Hello, I need a script similar to the one Oleh posted, but able to manage sentence instead of word separated by comma.

      For exemple sort :
      Acrobaties +15 (+11 pour sauter), Escalade +12, Diplomatie +9, Évasion +13, Perception +11, Représentation (instruments à cordes) +9, Escamotage?+13, Discrétion +17, Natation +10

      to :
      Acrobaties +15 (+11 pour sauter), Diplomatie +9, Discrétion +17, Escalade +12, Escamotage +13, Natation +10, Perception +11, Représentation (instruments à cordes) +9, Évasion +13

      Thanks a lot !

Viewing 4 reply threads
  • You must be logged in to reply to this topic.
Forum Ads