• Isadora
  • Get it
  • Forum
  • Help
  • ADD-ONS
  • Newsletter
  • Impressum
  • Dsgvo
  • Impressum
Forum
    • Categories
    • Recent
    • Popular
    • Tags
    • Register
    • Login

    [ANSWERED] Using Javascript to split a text string

    How To... ?
    3
    4
    127
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • T
      tingkumajique
      last edited by Woland


      Hi all,

      I'm trying to figure out why my javascript is not working properly.


      I have a string of text that is "participant name | 012" and I'm trying to use javascript to split the string into
      1. participant name
      2. index number
      using the split function

      However, I"m not getting the intended results as shown in the screenshot. I'm either sometimes getting the Name or Index only.

      Any help would be greatly appreciated. Thanks!

      JuriaanJ bonemapB 2 Replies Last reply Reply Quote 0
      • JuriaanJ
        Juriaan Tech Staff @tingkumajique
        last edited by

        @tingkumajique

        You have to mutate the outputs of the JavaScript actor to Text if you are working with text, you could simply do this by connecting any text input to the output field.

        Isadora 3.1.1, Dell XPS 17 9710, Windows 10
        Interactive Performance Designer, Freelance Artist, Scenographer, Lighting Designer, TroikaTronix Community moderator
        Always in for chatting about interaction in space / performance design. Drop me an email at hello@juriaan.me

        1 Reply Last reply Reply Quote 0
        • bonemapB
          bonemap Izzy Guru @tingkumajique
          last edited by

          @tingkumajique

          Hi,

          I put together a demo patch of Javascript text separation and joining options - its available to download from the Add-ons page. But here is one that might be useful: js-text-separator.zip

          Best Wishes,

          Russell

          http://bonemap.com | Australia
          Izzy STD/USB 3.2.6 | + Beta 3.x.x
          MBP 16” 2019 2.4 GHz Intel i9 64GB AMD Radeon Pro 5500 8 GB 4TB SSD | 14.1.2 Sonoma
          Mac Studio 2023 M2 Ultra 128GB | OSX 14.1.2 Sonoma
          A range of deployable older Macs

          1 Reply Last reply Reply Quote 1
          • T
            tingkumajique
            last edited by

            Ah thanks all for the pointers and examples 🙂

            Appreciate this community in my Isadora journey!

            1 Reply Last reply Reply Quote 0
            • First post
              Last post