Copy / Paste Buffer Access?

    Miscadvanced

    Jeff Caylor's icon
    Jeff Caylor's icon
    Jeff Caylor
    Mar 30 2023 | 2:32 am
    I do some Max development for Ableton Live and would love to create a simple device that lets me copy and paste frequently used text. I know there are ways to do this outside of Live but I'd really like to make a device that opens a giant cheatsheet that I can click an option and put it into the copy/paste buffer. Then, rename a locator and paste the copied text into the name field. There are some notepad solutions in Max but they seem to add weird line returns and mess up the text after a save / restore.
    I don't know of a device that lets you access the copy / paste buffer. I thought maybe even a cp command in SHELL but I don't know if that works for text and not just files.

    • Source Audio's icon
      Source Audio's icon
      Source Audio
      Mar 30 2023 | 8:59 am
      what is wrong with max text object ? it can read text file, you open it and copy/paste what you need. not that adding text into clipboard using shell is not working, but you anyway need to open that "giant cheatsheet" file to see it's contents
      Share
    • Roman Thilenius's icon
      Roman Thilenius's icon
      Roman Thilenius
      Mar 30 2023 | 10:35 am
      i use [var] as my in-max copy/paste clipboard.
      to store strings you might need to convert lists to symbols to do that.
    • Jeff Caylor's icon
      Jeff Caylor's icon
      Jeff Caylor
      Mar 30 2023 | 1:28 pm
      Thanks for the helpful replies. I'm looking for something a little more slick than a text file. And I literally want to use the text to CMD+V somewhere outside of max. I know it's a weird usage. I just want to pop up a menu with instructions and then a bit of text to copy and paste. Ideally you would click a little COPY icon button that grabs all the text without having to double or triple click. I think this will actually work with TextEdit if I just store the text in that object without storing it in a dict and pasting it back in or something. It's just a little more cumbersome that I wanted.
    • Source Audio's icon
      Source Audio's icon
      Source Audio
      Mar 30 2023 | 3:21 pm
      I am completely missing info where do you want to copy from. in whatever object text to copy is shown you must select it and then copy, no matter if using system wide shortcut or a button that executes copy command which that object that shows text understands
    • tyler mazaika's icon
      tyler mazaika's icon
      tyler mazaika
      Mar 30 2023 | 4:43 pm
      If you use [shell] external you may be able to pipe the text you want into the pbcopy command to put it in the system clipboard.
    • Roman Thilenius's icon
      Roman Thilenius's icon
      Roman Thilenius
      Mar 30 2023 | 8:48 pm
      hm, you can open a [text] object´s editor window and copy from there, but of course this window does not take keyboard commands or anything else triggered programmatically from max.
      unless... shell...
    • Jeff Caylor's icon
      Jeff Caylor's icon
      Jeff Caylor
      Mar 30 2023 | 11:18 pm
      Hey that's it, Tyler! Thanks so much. I was able to locate exactly what I needed online based on your direction. It's super basic but I was having trouble just trying to do this:
      echo "Hello world" | pbcopy
      I think feeding this into [shell] will do what I'm wanting.
    • Source Audio's icon
      Source Audio's icon
      Source Audio
      Mar 31 2023 | 7:58 am
      you can check this few out of ever repeating threads about clipboard
      https://cycling74.com/forums/object-or-method-to-interact-with-the-clipboard-copypaste https://cycling74.com/forums/copy-to-clipboard-with-n4m