While researching the MaxMenus privacy question (see details in the comments
here), I had a brief email correspondence with Ammon Skidmore, MaxMenus' programmer. He revealed a utility hidden within MaxMenus that allows you to initiate a drag of a file or folder from the command line! Here's what he wrote:
MaxMenus contains a command-line utility that allows you to initiate a file/folder drag and drop. This is what MaxMenus internally uses for it's "Grab" feature. The utility is inconspicuously named "MarsNeedsWomen", and is located in MaxMenus.app's Resources folder, located at ~/Library -> PreferencePanes -> MaxMenus.prefPane -> Contents -> Resources -> MaxMenus.app -> Contents -> Resources -> MarsNeedsWomen). I usually place a copy named "drag" in my ~/bin/ directory. Usage: % MarsNeedsWomen [file or folder name to drag]
Example #1 - Drag the current directory around: % MarsNeedsWomen .
Example #2 - Drag the console.log file so you can easily open it in a gui text editor: % MarsNeedsWomen /var/tmp/console.log
Notes & limitations:- If the mouse is up when you start the drag, the drag will float on the screen until you click and drag it.
- Only one file/folder can be dragged at a time in this version.
- There can be problems with dragging items of unusual filenames, such as names containing characters with accents.
As a heavy Terminal user, I find this utility really useful in its current form because I often find myself working with a stuff in the Terminal that I need to use in another app. So I'll just initiate the drag from the Terminal then drop it over LiteSwitch, the Dock, or MaxMenus to open the item in another app.
Well, there you have it. Depending on the response I get from this tip I'll improve the utility some more.
You can install the trial version of MaxMenus to test out this cool utility. It's hard to describe until you've seen it in action, but it's quite cool. As Ammon described, I created a copy in ~/bin and called it "drg". When I type "drg some_file," a small floating icon appears just waiting to be dragged somewhere useful.