Re: Any way to Rename a File that is being Dragged before it's Dropped?
Re: Any way to Rename a File that is being Dragged before it's Dropped?
- Subject: Re: Any way to Rename a File that is being Dragged before it's Dropped?
- From: "email@hidden" <email@hidden>
- Date: Sun, 10 Jan 2016 15:11:35 -0500
>>> Is there any way to cut out this ’staging’ folder? To somehow Drag a file named: ‘0012345.m4a’ from the server (mounted via AFP) directly onto the Desktop, or an app like Logic, and have it Dropped with a name like: ‘aaa bbb ccc ddd.m4a’?
>>
>> Sure — in general it’s possible to let the user drag a file that doesn’t exist yet, then create the file in the dropped-on folder. The drag data you provide isn’t a regular file flavor, but a special thing called a “file promise” or “HFS promise” that specifies what type of file it will be; then on drop you get the location to write the file to. The Cocoa docs should have more info.
>>
>> —Jens
Took a while to dovetail this in to the tableView, since the ‘Promise’ drag has to originate from the tableView subclass, whereas standard drags are handled by the tableView delegate, but all works like a charm now, as I forward option clicks to the TV subclass. I can copy files with a new name to the destination folder.
Only problem seems to be that Logic doesn't respond to a dropped File Promise, so the staging folder is still required. I’m very mystified by this, as Finder and iTunes both do support this, and they’re all Apple apps.
Thanks for the suggestion,
Rob
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden