You are not logged in.

Dear visitor, welcome to KDE-Forum.org. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Monday, March 3rd 2008, 1:18am

KDE Drag-and-drop/scripting question

I want to create an icon on the desktop for dragging and dropping files onto (for a wife friendly script essentially). I wrote a quick test to make sure it would work how I expected.

Source code

1
2
3
4
5
6
7
8
9
$file = "";
while (defined($file))
{
        if ($file ne "")
        {
                print "ARGV = [$file]\n";
        }
        $file = shift (@ARGV);
}

When I ran it, instead of one window with four printed lines, I got four spawned windows with a single printed file.

I could jiggery pokery and make it work, but I'd rather find a way to do it more simply.

Is there a way to get all four files to go to the same script process? Barring that, is there a utility that will do something similar and then would kick off my script?