On Wed, Feb 26, 2003 at 10:46:05AM -0600, Ken Williams wrote:
> Awesome - I'm now adding a little perl script around it to get the
> absolute path and to activate the Finder:
Nice script: I think you can probably save some execution time
by incorporating both finder calls in the same osascript call:
try something like the following (which I've called "psel" on
my machine, as "select" has already been grabbed by zsh). I like
the "heredoc" quoting of applescripts as it pretty much allows
drag and drop to/from the applescript editor.
Cheers,
Paul
------------------------------------------------------------------
#!/usr/bin/perl
my $file = shift or die "No file specified";
use File::Spec;
$file = File::Spec->rel2abs($file)
if !File::Spec->file_name_is_absolute($file);
system(qq{osascript <<END
tell application "Finder"
reveal "$file" as POSIX file as alias
activate
end tell
END
});