Forum
    • Categories
    • Register
    • Login

    Drag and drop multiple audio files onto a ScriptPanel?

    Scheduled Pinned Locked Moved Scripting
    2 Posts 2 Posters 16 Views
    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.
    • CyberGenC
      CyberGen
      last edited by

      Hi everyone,

      I’m building a custom samplemap editor / instrument builder inside a scripted UI. The goal is to let users drag audio samples from Finder onto a ScriptPanel keymap, preview where the zones will land, then drop them to import and map the samples.

      Single-file drag and drop is working well. I’m using:

      Panel.setFileDropCallback("All Callbacks", "*.wav;*.aif;*.aiff", function(f)
      {
          if (f.hover)
          {
              // update keymap preview from f.x / f.y
          }
      
          if (f.drop)
          {
              // import f.fileName
          }
      });
      

      The problem is multi-file drag/drop from Finder. When I select multiple audio files and drag them over the scripted panel, HISE rejects the drag and the files fly back to Finder. The callback does not seem to fire, so I never get a chance to inspect whether f.fileName is an array.

      I tried:

      • *.wav;*.aif;*.aiff
      • *.wav,*.aif,*.aiff
      • *.*
      • *
      • a narrow *.aif test with only .aif files selected

      Single-file drop works, but multi-file drop still gets rejected before the callback. The docs say f.fileName should be an array if more than one matching file is dropped, so I assume this should be possible from script.

      What I’m trying to reproduce is similar to HISE’s native SampleMap Editor behavior: drag multiple samples into the map, then choose a mapping mode like Drop Point, Filename Token Parser, etc. I don’t need to invoke the native dialog directly, but I do need the scripted panel to receive the full dropped file list.

      Questions:

      • Is ScriptPanel.setFileDropCallback() expected to accept multi-file drags from Finder on macOS?
      • Is there a specific wildcard format or callback level required for this?
      • Does multi-file drag only work from HISE’s internal file browser rather than Finder?
      • Is the native SampleMap Editor using a different internal drag/drop path that isn’t exposed to scripting?
      • Is there a workaround, eg. folder drop, Broadcaster, FloatingTile, or using the Sampler/SampleMap editor API?

      Any guidance would be hugely appreciated.

      David HealeyD 1 Reply Last reply Reply Quote 0
      • David HealeyD
        David Healey @CyberGen
        last edited by

        @CyberGen said in Drag and drop multiple audio files onto a ScriptPanel?:

        s there a workaround, eg. folder drop

        Folder drop

        if you want to only allow folders to be dropped, you need to supply the string "{FOLDER}" as wildcard.

        https://docs.hise.audio/scripting/scripting-api/scriptpanel/index.html#setfiledropcallback

        Free HISE Bootcamp Full Course for beginners.
        YouTube Channel - Public HISE tutorials
        My Patreon - HISE tutorials

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

        21

        Online

        2.3k

        Users

        13.6k

        Topics

        118.7k

        Posts