weird photoshop result

Hi there,
I have a script that checks the colour mode of the current Photoshop document. When I run the code below it displays a dialog message of “CMYK” as expected.

tell application "Adobe Photoshop CS2"
	set colour_mode to mode of current document as string
	display dialog colour_mode
end tell

When I add an idle handler to this I get a completely different result “«constant ****e083»”

on idle
	tell application "Adobe Photoshop CS2"
		set colour_mode to mode of current document as string
		display dialog colour_mode
	end tell
end idle

Any ideas why this is happening?
Thanks,
Nik

Hi,
on further investigation I’ve discoved that it’s nothing to do with the idle handler but the difference between running the code as a script which returns the expected result and then saving the code as an application and it returning the wrong one. Any ideas?

Hi Nik,
yes thats right that you got the result as RAW-code when you save the Script as App.
Use this:

tell application "Adobe Photoshop CS2"
	set colour_mode to mode of current document
	if colour_mode = RGB then set colour_mode to "RGB"
-- if ... then...
	display dialog colour_mode
end tell

Greets from
TMA

Model: MacBook Pro 2.4 GHz Intel Core 2 Duo, 4 GB RAM
Browser: Safari 419.3
Operating System: Mac OS X (10.4)