Re: [Cocoadialog-users] Bourne Shell Script Equivalent to Perl Script Sample for CocoaDialog Dropdo
Status: Beta
Brought to you by:
sporkstorms
From: Mark A. S. <ma...@sp...> - 2008-12-02 17:17:55
|
There isn't such a flag. But if we look at this example: http://cocoadialog.sourceforge.net/examples/fileselect.sh.txt there's a 'while' loop in there that iterates over every line of $rv, each containing a file path. It would be trivial to add a counter variable in there to count the number of files. Surely there's some sort of shell trick to count the number of newline-separated entries in $rv if you don't want to loop over it. I'm not much of a shell coder though, so unfortunately I can't tell you how to do this (or confirm that it's definitely possible). In case it helps, in Perl you can just do: scalar( split /\n/, $rv ); to get the number of files listed in $rv (a return value from cocoadialog). - mark Thomas Patko wrote: > Is there a way to return the number of files selected when using the > filselect cocoadialog with --select-multiple option enabled? This would be > quite convenient and I am wondering if there is a flag to return this value > as perhaps the first return variable followed by all of the file paths > thereafter? > > Thanks, > > Thomas > > |