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

Re: [MacPerl] Q: apps for getting file path



At 01.03 1/3/98, Xah Lee wrote:
> Frequently, one needs the path (as string) of arbitrary folder or file.
> BBEdit can help but the process is still cumbersome. I'm wondering,
> what's you guy's solution?
>
> Is there a utility that lets one get any file/folder path easily? (e.g.
> popup menu etc.) I used to use OSA Menu with Frontier (i.e. select a
> file/folder, then pull the script/menu Copy Path) but I don't want to
> launch Frontier just for this.

Hm.  Here is one quick script that will prompt you with a dialog box.
Doesn't work for folders, though.

#!perl -w
use Mac::StandardFile;
my $file = StandardGetFile(0, 0);
print $file->sfFile(), "\n" if ($file->sfGood());

Mac::StandardFile is covered in the Toolbox Modules chapter of the book,
available for review from the URL below.

Here is a droplet that I keep in my "Open Using" Contextual Menu (BTW, if
you can get CMTools, do so.  It is a great addition to using droplets.  All
droplets that I use frequently I keep there for quick access from the
desktop).

#!perl
print join("\n", @ARGV);

Anyway, that droplet is pretty much as simple as you can get.  :)

Hope this helps,

--
Chris Nandor               pudge@pobox.com           http://pudge.net/
%PGPKey=('B76E72AD',[1024,'0824 090B CE73 CA10  1FF7 7F13 8180 B6B6'])
#==                    MacPerl: Power and Ease                     ==#
#==    Publishing Date: Early 1998. http://www.ptf.com/macperl/    ==#



***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch