InDesign - Different results running a script from Editor or as an App

I have written a script which is running correctly when I run through the script editor, however part of it fails when I run the script as a saved script or application. The part which is failing is checking for modified links in InDesign CS4.

When running as a script (from Script Editor) this section returns true

tell application “Adobe InDesign CS4”
set TrueOrFalse to {false}
tell document 1
set CountOfLinks to (count of links)
repeat with ThisLink from 1 to CountOfLinks
set ThisLinkStatus to status of (properties of link ThisLink)
if (ThisLinkStatus as string) = “link out of date” then
set TrueOrFalse to {true}
end if
end repeat
display dialog TrueOrFalse
end tell
end tell

but when running as an application it returns false!

On closer inspection it is because InDesign itself it returning “link out of date” for a modified image for the script (from Script Editor) but returning <<constant ****lood>> when running as an App

Has anyone seen this before, do you have an explanation or maybe a fix?

Otherwise can someone help me deal with the <<constant ****lood>> message

Thanks in advance, Ken

Model: Mac Book
Browser: Safari 525.27.1
Operating System: Mac OS X (10.5)

Hi,

the status messages are enumerated constants, so maybe it’s better to check the constant, not the coerced string


tell application "Adobe InDesign CS3" -- or CS4
	set TrueOrFalse to false
	tell document 1
		repeat with ThisLink from 1 to (count of links)
			if (get status of link ThisLink) is link out of date then
				set TrueOrFalse to true
			end if
		end repeat
	end tell
	display dialog TrueOrFalse as text
end tell

Excellent, that’s cracked it.

Note to self, must read up on enumerated constants :slight_smile:

Thanks a lot Stefan