I’m not sure where the captureImage command went after v3.0 … however, the same feature should be available using the captureScreen command:
Example: CaptureScreen (Name: “ImageFileName”, Rectangle: ((67,33), imagelocation: “OtherCorner”)
Parameters: An optional property list.
Behavior: Captures a snapshot of the entire Viewer window, or a rectangle indicated in the property list. You can customize this command with a list of any number of the following properties:
[list]Name - An image file name and optional path information. (The default value is Capture_Screen.tiff, saved in the Results directory.)
Rectangle (or Rect) - A pair of diagonal locations indicating a rectangle to capture. (The locations can be screen coordinates, and/or image locations.)
Increment - A value of yes or true appends an automatically incremented number to the image. (The default value is no.)
ImageInfo - A property list of additional information. (For more information, see the ImageInfo() function.) [/list:u]
Tip: Incrementing is helpful if you are capturing several snapshots within a script (as in a loop or frequently called handler.) The images can all have the same image name, with the incremented number distinguishing them; otherwise, each image would overwrite the previous image with the same name.
Your last question hit a good point. You must have text-image caching turned on so you can access the image manually in the script’s TextImages folder for a comparison and to fully understand what its trying to match.
defaults write com.redstonesoftware.Eggplant TextCache -bool YES
Note: this is done in the Mac’s Terminal application, not in eggPlant
From a practical standpoint, turning the cache on during script development is useful, and turning it off in production may be a good approach.
After a script is run, be aware that if a text image is not found, you cannot compare the image because it does not exist in the script’s results – unless you have caching turned on, at least in my experience.