• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Finding Files (was: watermark)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Finding Files (was: watermark)


  • Subject: Finding Files (was: watermark)
  • From: Christopher Stone <email@hidden>
  • Date: Fri, 23 Oct 2009 08:24:07 -0500

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)
  http://apps.tempel.org/FindAnyFile/

EasyFind  (freeware)
  http://www.devon-technologies.com/products/freeware/index.html

FileBuddy (Commercial and my multi-purpose utility of choice.)
  http://www.skytag.com/filebuddy/en/9/index.html

* 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.

--
Chris

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: Finding Files (was: watermark)
      • From: "Mark J. Reed" <email@hidden>
References: 
 >Re: watermark (From: Rounak Jain <email@hidden>)

  • Prev by Date: Re: Visual Basic versus AppleScript
  • Next by Date: Re: Finding Files (was: watermark)
  • Previous by thread: Re: watermark
  • Next by thread: Re: Finding Files (was: watermark)
  • Index(es):
    • Date
    • Thread