Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Quick edits to folder action script, and a quick folder action scripts how to' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Quick edits to folder action script, and a quick folder action scripts how to
Authored by: paulw on Feb 18, '10 02:09:59PM
The folder action script works as long as your TIFF file extension is "tif" and not ".tiff" (which seems to be the default for images my Mac converts to TIFF. tesseract only likes ".tif" extensions.

sjinsjca's script seems to be set up for making the adjustment, but it doesn't quite do it. Here's what you do to edit the script to change ".tiff" files to ".tif" before feeding they get fed to the tesseract shell script.

1. change the line:
property newimage_extension : ""
to
property newimage_extension : "tif"

2. change the line:
property extension_list : {"tif"}
to
property extension_list : {"tif", "tiff"}
3. after the line:
set the source_file to (move this_item to the originals_folder with replacing) as alias
add this line:
set name of source_file to new_name

The script should now successfully process files ending in ".tiff" as well as ".tif".

Quick Folder Action Script Creation Steps

1. Copy the script text from the hint.

2. Open the application "Applescript Editor" (In Application > Utilities)

3. Paste the script text into the script editing window.
4. Hit "compile" and it will probably give you an error message because there are line breaks from your pasted text that shouldn't be there. In most cases you can just hit "ok" and then hit the space bar to replace the highlighted linebreak with a space. Sometimes it requires manually fixing a linebreak-- in this script, "giving up after 120" should not be on its own line, but should finish the line before it.

5. When you can hit "compile" without an error message, consider making the edits I suggested.

6. Save the script in your User folder > Library > Scripts > Folder Action Scripts. If you don't have a "Folder Action Scripts" folder, create one there.

7. Do a Spotlight search for "Folder Actions Setup.app" and fire it up.

8. Select the folder (create it first in Finder if need be) you want to add a folder action script to. On the right-hand pane, hit the + sign and select the script you just saved from the available list.

9. Be sure "Enable Folder Actions" is checked, and quit.

[ Reply to This | # ]
Quick edits to folder action script, and a quick folder action scripts how to
Authored by: sjinsjca on Feb 18, '10 02:24:37PM

Wonderful suggestions, thanks very much.



[ Reply to This | # ]