PreFab...Player...Cool Uses...Photoshop...

Save to Done Folder

This script uses subroutines so that the main repeat loop is only a few lines. (Only the pertinent subroutine is included here; the full example ships with Player 1.1.)
-- simple Photoshop batch processing example for Player 1.1
-- save as compressed PC TIFF file

set batchFolder to choose folder
-- set batchFolder to "disk:folder:"

set doneFolder to createDoneFolder(batchFolder)

tell application "Finder"
	-- "document file" excludes aliases, apps, control panels, etc.
	set listOfFiles to (get every document file of folder batchFolder whose file type is not "TIFF")
end tell

activatePhotoshop()

set firstFile to true
repeat with imageFile in listOfFiles
	if openImage(imageFile) then
		saveAsCompressedPCTIFFTo(doneFolder, firstFile)
		closeImage()
		set firstFile to false
	end if
end repeat

activate me
display dialog "Done processing folder!"

-- --------------------------------- subroutines ---------------------------------
on saveAsCompressedPCTIFFTo(outputFolder, isFirstFile)
	tell application "PreFab PlayerŞ"
		set dialog folder to outputFolder
		do menu menu item "Save As" of menu "File" with repeat until successful
		
		-- the following lines shouldn't be required in the released version of Player 1.1
		click button "Cancel" -- had to cancel and do "Save as" again to get the path to folder to be accepted.
		do menu menu item "Save As" of menu "File"
		
		do menu popup item "TIFF" of popup "Format"
		type {right arrow, ".tif", enter}
		if exists button "Replace" then
			click button "Replace"
		end if
		if isFirstFile then -- save a little bit of time by skipping on subsequent files
			click radio button "IBM PC"
			set value of checkbox "LZW Compression" to 1
		end if
		click button "OK"
	end tell
end saveAsCompressedPCTIFFTo

-- ---------------------------------------- 

| Top |


Subroutines & parameters| Prev | Home | Next |To CMYK TIFF, Omit .PICT

Updated on 10/7/96 by Scott S. Lawton (ssl@prefab.com)

Copyright 1993-97, PreFab Software, Inc. All Rights Reserved.

This site built and maintained using Stage Three, a set of custom Frontier scripts.