drag files FROM Max, solved
Hi!
We have [dropfile] to be a drag n' drop target but we have no source for such operation in Max. Can anyone provide some code snippet or examples in C that deal with drag n drop of files (being the source) or has already done some investigation into that direction? Win or Mac doesn't matter, looking for a solution on both.
max doesnt know anything about the path which the mouse is theoretically pointing on when it is in the finder/explorer i am afraid.
but as a workaround why not use dropfile to drop a target folder onto it and then have an "export" or "save" button beside it. (maybe with "desktop" and "user/.../max 7/..." as default locations)
What I want is sending a list of filenames to an external which is then telling the OS to drag these files until mouse is released. To any target. I don't think the drag source has to know much about the target..
i'm tired of doing workarounds ;)
lg
O.
you (the external) somehow must link the mouse position to the OS browser. well, maybe that is possible (just as screen recording once was possible with nato)
but what do i know about externals. the only thing i know is that it can be wise to remain sceptical. about everything. :)
i remember well how baffled (or better amazed) i was when i found out that the drag and rop manager in mac os 7 allowed to drag and drop layers of pictures files directly between photoshop 3 and graphic converter.
I have promising results. For Windows Anders Karlsson created this library https://sourceforge.net/projects/win32cdnd/ that allows handling some stuff on a slightly higher level. He tagged it as GPL 2.0.
If I use this I have to go with GPL 2.0, too. Does this work for an external?
As I understand it would force everyone using it to distribute the source with it. Can we just link for example to a github repo instead?
Everyone using it must release under GPL 2. I understand this when the sourcecode is reused for another external but how far does it go up the chain.
It doesn't mean the patcher or standalone or m4live device using the external has to go with GPL, right?
11Olsen, it works great. This is fantastic news. Thank you so much.
Hugo
11Olsen, how can i use this in to my max patch?
The help file for the object is pretty self-explanatory, isn't it? Or do you mean how to use 3rd party externals in general?
bump... we really could use a native solution for this now.
how would a generic [dragfile] look like?
wouldn´t it be a feature of all the individual objects who would have to be updated to support that?
how would you go about dragging an audiofile from a buffer to desktop? i think it would mean to add additional outlets to these objects to link them to [dragfile].
or it could maybe work... [grab]-like...
how would a generic [dragfile] look like?
[11dragfiles], the external made by 11Olsen was pretty straightforward: click and hold a button/message that sends the path of a file (or multiple files) to the object, and that (those) file(s) get "added to your cursor" until you release the click wherever you want, including another patcher, [dropfile], Finder, other apps... It seems to use the native OS drag'n'drop mechanism, so its support is as wide as it is.
Also, fwiw, it is possible to drag and drop items between [chooser] and [playlist~], [buffer~] and other objects, including across multiple patchers. Definitely not for the same use, but still useful for some uses.
yeah, i see, it could of course be limited to collecting the path and leaving the rest to the patch code, just like dropfile does.
though then you could almost use dropfile for that purpose, under macos even from an open finder window. i do that sometimes for "choose output folder" functions. it is just dragging in the opposite direction than you would expect. :)
far more sexy would be if waveform~ or coll would support it directly - (or [patcher]!) - that is why that question arose how to cover all the different messages and file type options.