Of course it's possible, you are probably misunderstanding me. When you drop in a file, the console displays its path, and then the script can take that as input.
So what my code does is:
1. tell the user to drag and drop a file in the console, wait for input via STDIN
2. user drags & drops file from file manager into console, the full filepath appears in the console, user presses enter
3. the script stores the string with the filepath in a variable, parses it, opens the file, magic happens
Pretty much all OSes have this functionality apart from Windows Vista (XP and Win7 have it, Vista is the only one that doesn't).
This is pretty much the default method for cd'ing into a directory for most people... you type "cd ", drag and drop a folder and press enter... it eliminates a hell of a lot of typing.
It works fine in my script in most scenarios, but not with accented characters on Windows.
BTW the same will often work with URLs, depending on what browser you have and which bit you're grabbing. If you grab a photo from an open webpage, the URL of the image should appear in the console, and you can often drag & drop favicons or links etc.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.