[PS CS2] Batch convert rgb->cmyk, jpg->tif, 72dpi->304,8dpi

hi folks,

i got a little poblem with applescript. i have to convert a lot of jpeg with photoshop (RGB into CMYK, 72 dpi into 304,8 dpi and last but not least jpg into tiff). I searched the whole forum for hours finding the right thread. Having no success i’ll post my script here. there will be a watched folder (called +in) and a taget folder (called +out). right, you know what i am talking about :slight_smile: files will be copied into the +in-Folder and photoshop starts to convert the resolution and mode. applescript will save the file into tiff (with photoshop parameters).

like this:

on adding folder items to this_folder after receiving these_items
	tell application "Adobe Photoshop CS2"
		activate
		open theFile
		set display dialogs to never
		set thisdoc to current document
		if (mode of thisdoc is not CMYK) then
			change mode thisdoc to CMYK
			do action "Aktion2" from "action"
			set myOptions to {class:TIFF save options, byte order:Mac OS, embed color profile:false, image compression:LZW}
			save thisdoc in (path to desktop folder) as TIFF with options myOptions appending lowercase extension without copying
			close current document saving no
		end if
	end tell
end adding folder items to

can anybody help me? it doesn’t work on my mac… :frowning: thx alot for help!

Heiner

Model: MacBookPro
Browser: Safari 525.20.1
Operating System: Mac OS X (10.5)

Hi

Try this:

on adding folder items to this_folder after receiving these_items
	repeat with theFile in these_items
		tell application "Adobe Photoshop CS2"
			activate
			open theFile
			set display dialogs to never
			set thisdoc to current document
			if (mode of thisdoc is not CMYK) then
				change mode thisdoc to CMYK
				do action "Aktion2" from "action"
				set myOptions to {class:TIFF save options, byte order:Mac OS, embed color profile:false, image compression:LZW}
				save thisdoc in (path to desktop folder) as TIFF with options myOptions appending lowercase extension without copying
				close current document saving no
			end if
		end tell
	end repeat
end adding folder items to

hi pidge,

thanks for your fast reply. works great. can you tell me how the generated file will be placed in out-Folder an not on desktop? the out-folder still exists.

thx alot,
Heiner

Hi

This assumes you have the folder “+out” on your desktop.

on adding folder items to this_folder after receiving these_items
	repeat with theFile in these_items
		tell application "Adobe Photoshop CS2"
			activate
			open theFile
			set display dialogs to never
			set thisdoc to current document
			if (mode of thisdoc is not CMYK) then
				change mode thisdoc to CMYK
				do action "Aktion2" from "action"
				set myOptions to {class:TIFF save options, byte order:Mac OS, embed color profile:false, image compression:LZW}
				save thisdoc in ((path to desktop folder) & "+out" as string) as TIFF with options myOptions appending lowercase extension without copying
				close current document saving no
			end if
		end tell
	end repeat
end adding folder items to

thx and sorry. the folder structure is:

1 converter
1.1 +in (script)
1.2 +out

i looked up apples manual http://developer.apple.com/documentation/AppleScript/Conceptual/AppleScriptLangGuide/AppleScriptLanguageGuide.pdf but i am confused. the folder “+in” is at the same level like “+out”.

How would the code look like?

thx,
Heiner

Hi

Once again this does assume that the folder called “convertor” is on the desktop and inside it is a folder called “+out”

on adding folder items to this_folder after receiving these_items
   repeat with theFile in these_items
       tell application "Adobe Photoshop CS2"
           activate
           open theFile
           set display dialogs to never
           set thisdoc to current document
           if (mode of thisdoc is not CMYK) then
               change mode thisdoc to CMYK
               do action "Aktion2" from "action"
               set myOptions to {class:TIFF save options, byte order:Mac OS, embed color profile:false, image compression:LZW}
               save thisdoc in ((path to desktop folder) & "convertor:+out" as string) as TIFF with options myOptions appending lowercase extension without copying
               close current document saving no
           end if
       end tell
   end repeat
end adding folder items to

thanks a lot!

Heiner

okay, now i got an other problem with the same script.

the folder exists on mac1 and works as a hot folder via lan. mac2 is connected via afp to this folder (sharepoints). When i put some JPG from mac2 into the folder on mac1 nothing happens. But when I put some file from mac1 into the folder the script runs. What is wrong? Should there be a little delay in the script? And if so, how do i do it? :frowning:

Thanks,
Heier

Hi

Not sure what is happening but if you want to add a delay in the script then heres how:
simply add the word “delay” and then the amount in seconds how long you want the delay!
so to delay 10 seconds then add this line.

delay 10