Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Use MaxMenus to initiate drag actions in the Terminal UNIX
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's Resources folder, located at ~/Library -> PreferencePanes -> MaxMenus.prefPane -> Contents -> Resources -> -> 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.
  • Currently 2.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (2 votes cast)

Use MaxMenus to initiate drag actions in the Terminal | 7 comments | Create New Account
Click here to return to the 'Use MaxMenus to initiate drag actions in the Terminal' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Correct Path
Authored by: bluehz on Dec 20, '02 10:32:14AM

The path you listed was a little incorrect. Most people woudl know it - but for the newbies. The correct cmd to copy the noted binary (MarsNeedsWomen) to /usr/local/bin is:

sudo cp -p ~/Library/PreferencePanes/MaxMenus.prefPane/
Contents/Resources/MarsNeedsWomen /usr/local/bin/drg

(the above should be all on one line in the terminal)

This copies it to the /usr/local/bin dir and renames it drg. Make sure to do a rehash in your terminal before attempting to use it.

[ Reply to This | # ]
Correct Path
Authored by: robg on Dec 20, '02 10:42:26AM

Argh ... my fault, sorry. I just fixed the original...


[ Reply to This | # ]
Authored by: brising on Dec 20, '02 10:47:00AM

You might also want to mention that if MaxMenus is installed for all users, the leading ~ is not needed in the path.

This tip works just fine, and it's really a clever little app, but boy it is strange!

[ Reply to This | # ]
Use MaxMenus to initiate drag actions in the Terminal
Authored by: gteague on Dec 20, '02 08:37:46PM

great tip! i can really use that.



[ Reply to This | # ]
Great app & hint!
Authored by: ├člue on Dec 21, '02 06:09:39AM


[ Reply to This | # ]
Symlinks are Your Friends
Authored by: readparse on Dec 25, '02 11:17:14PM
Let me be the token unix guy for a moment and suggest that symlinks are cooler than copies, depending of course on what you want to do. I think this utility is interesting, but of course, I didn't want to have to go to that obfuscated path, so I linked it like so:
sudo ln -s /Library/PreferencePanes/MaxMenus.prefPane/Contents/Resources/ /usr/bin/dragit
So now, to examine /usr/bin/dragit...
% ls -l /usr/bin/dragit
/usr/bin/dragit -> /Library/PreferencePanes/MaxMenus.prefPane/Contents/Resources/
Now I can use the command "dragit" from anywhere, and logged in as anybody. Cheers, John

[ Reply to This | # ]
Authored by: pingpong on Jan 26, '05 03:23:56AM

a more powerful (shareware) alternative is available.

allows text drags. allows dragging of multiple files. puts a title on the drag proxy, so you can see the name of your file if you leave it sitting around for a while after you drag it.

[ Reply to This | # ]