[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

re: [MacPerl] ordering of files in Drag-n-drop from Finder



On Thu, 12 Sep 1996, Paul Schinder wrote:

> schabel@leland.stanford.edu (Matthias Schabel) writes:
> } Does anyone know how the Finder orders selected files; for example, imagine

[...snip...]

> } and drag-n-drop them onto a perl script.  When I do this, I find that the
> } filenames are sorted before being processed by the script; is it the perl
> } interpreter doing this or does the Finder sort the list first?  In either
> } case, is there any way to preserve the order in which the files are
> } selected?
> 
> The Finder, based on my experience.  They seem to be sorted the same
> way they would appear in the Finder.  If you have them sorted by name,
> they're alphabetical, by date, and they're by date, etc.  If you want
> them sorted in some way the Finder understands, you can just choose
> what you want in the Finder's View menu.  Otherwise, I believe you're
> out of luck although maybe there's a sneaky way to do things with drag
> and drop aware apps like Find File.  Of course, you can always have
> MacPerl sort @ARGV any way you'd like once it gets it.

[...snip...] 
> --------
> Paul J. Schinder
> NASA Goddard Space Flight Center,
> Code 693, Greenbelt, MD 20771 USA
> schinder@pjstoaster.pg.md.us
> 

        I wasnt' too sure about this answer, so I figured I'd pipe up about it. 
I found that the order is dictated by the selection in the View menu of 
the finder, just as Paul said. But if you select View by Icon or View by 
Small Icon then the order you select the files you drop is the order they 
appear in @ARGV. I've written one or two scripts that do depend on the 
order of the arguments, and that is how I imposed order over those 
arguments. I think that is what Paul said, but I just wasn't sure. Has 
anyone found otherwise?

Reg
------------------------------------------------------------
 "when I thought I came from  | Rajanikanth "Reg" Tanikella,
 nowhere I came from every-   |    Peripheral Visionary
 where instead" --Jesus Jones |    rkt@bc.cybernex.net
------------------------------------------------------</sig>