This is my sample code from the platypus tutorial.
I am trying to make it work with a command named pymol, and I want it to open .pdb files or open just pymol. I know nothing about perl, but I have basic sh knowledge and can do aliases and modify .zshrc files.
According to CommonMediaInc,
Filling the gap is Platypus, a handy little utility which makes application bundles out of Unix scripts. Notice I didn’t say “Perl” there. Platypus plays nicely with shell scripts, Python, PHP, Ruby, and Tcl just as easily as Perl. As the developer describes it, “this is done by wrapping the script in an application bundle directory structure along with an executable binary that runs the script.”
So hopefully someone here can help with making a small, usable droplet (drag-and-drop icon) to open files dropped to this app (while switching to the path of the file).
#!/usr/bin/perl
use strict;
use File::Basename;
my $cmd = "/usr/bin/tar cvfz";
# Get enclosing folder of first file
my($fn, $directory) = fileparse($ARGV[0]);
# Change to that directory
chdir($directory);
# Archive is created there
my $dest_path = "Archive.tgz";
my $files;
foreach(@ARGV)
{
my($filename, $directory) = fileparse($_);
$files .= "'$filename' ";
}
print $cmd . "\n";
system("$cmd $dest_path $files");