On Oct 22, 2009, at 23:20, Rounak Jain wrote: I cannot use do shell script "composite -gravity center watermark.png image.tif result.jpg" because I get the error sh: composite: command not found
But i can't find the path for "composite". It is not in /usr/bin and I checked some
______________________________________________________________________
Hey Rounak,
In the Terminal:
'which composite' # Already noted...
'which' is useful for finding errant Unix executables.
'which -a perl' for all rather than just the first one. In my case I now have two.
There's always 'find', but it is excruciatingly slow. # Using Extended regular expressions and searching only files modified in the last day. # Assuming that 'composite' is the end of the found-string. # It took 3 minutes to find the file on my old G4 PowerBook and 8 minutes to finish running with a 100GB hard drive.
find -E / -mtime -1 -regex ".*composite$"
There's 'locate' which is quite fast if you keep the database current, although I hear there's something wrong with it on Mac OS X (not tested).
Spotlight from the commandline works like a charm: # Basic name search: mdfind "kMDItemDisplayName == composite" --> /opt/local/bin/composite
# A little more paranoid using case-insensitive and wildcards mdfind "kMDItemDisplayName == \"*composite*\"c" --> 51 Lines output omitted
# Knowing the executable should be in a 'bin' directory somewhere: mdfind "kMDItemDisplayName == \"*composite*\"c" | egrep -i /bin/ --> /opt/local/bin/composite
Then there are some conventional file-finders:
FindAnyFile (freeware)
EasyFind (freeware)
FileBuddy (Commercial and my multi-purpose utility of choice.)
* Note-to-self: check dependencies before installing via MacPorts...
For ImageMagick: Extract Dependencies: p7zip Build Dependencies: pkgconfig Library Dependencies: xorg-libXext, xorg-libXt, bzip2, jpeg, libpng, tiff, zlib, freetype, fontconfig, libiconv, expat, libxml2 And finally: Perl 5.8.9 - up from 5.8.8 (a big surprise). It took a tediously long time.
|